func (k *KeyPairs) Post(ctx context.Context, pubKey, privKey,
	claim *envelope.Signed) (*envelope.Signed, *envelope.Signed, []envelope.Signed, error) {

	req, err := k.client.NewRequest("POST", "/keypairs", nil,
		ClaimedKeyPair{
			PublicKey:  pubKey,
			PrivateKey: privKey,
			Claims:     []envelope.Signed{*claim},
		})
	if err != nil {
		log.Printf("Error building http request: %s", err)
		return nil, nil, nil, err
	}

	resp := ClaimedKeyPair{}
	_, err = k.client.Do(ctx, req, &resp)
	if err != nil {
		log.Printf("Failed to create signing keypair: %s", err)
		return nil, nil, nil, err
	}

	return resp.PublicKey, resp.PrivateKey, resp.Claims, nil
}
// Post creates a new keypair on the registry.
//
// The keypair includes the user's public key, private key, and a self-signed
// claim on the public key.
//
// keys may be either signing or encryption keys.
Post creates a new keypair on the registry.

The keypair includes the user's public key, private key, and a self-signed
claim on the public key.

keys may be either signing or encryption keys.
// Post creates a new keypair on the registry . // // The keypair includes the user ' s public key private key and a self - signed // claim on the public key . // // keys may be either signing or encryption keys .
func (k *KeyPairs) Post(ctx context.Context, pubKey, privKey,
	claim *envelope.Signed) (*envelope.Signed, *envelope.Signed, []envelope.Signed, error) {
	req, err := k.client.NewRequest("POST", "/keypairs", nil,
		ClaimedKeyPair{
			PublicKey:  pubKey,
			PrivateKey: privKey,
			Claims:     []envelope.Signed{*claim},
		})
	if err != nil {
		log.Printf("Error building http request: %s", err)
		return nil, nil, nil, err
	}
	resp := ClaimedKeyPair{}
	_, err = k.client.Do(ctx, req, &resp)
	if err != nil {
		log.Printf("Failed to create signing keypair: %s", err)
		return nil, nil, nil, err
	}
	return resp.PublicKey, resp.PrivateKey, resp.Claims, nil
}
func ( k * KeyPairs ) Post ( ctx context . Context , pubKey , privKey , claim * envelope . Signed ) ( * envelope . Signed , * envelope . Signed , [ ] envelope . Signed , error ) { req , err := k . client . NewRequest ( " " , " " , nil , ClaimedKeyPair { PublicKey : pubKey , PrivateKey : privKey , Claims : [ ] envelope . Signed { * claim } , } ) if err != nil { log . Printf ( " " , err ) return nil , nil , nil , err } resp := ClaimedKeyPair { } _ , err = k . client . Do ( ctx , req , & resp ) if err != nil { log . Printf ( " " , err ) return nil , nil , nil , err } return resp . PublicKey , resp . PrivateKey , resp . Claims , nil }
Post creates a new keypair on the registry.
Post creates a new keypair on the registry .