public_key_t *public;
chunk_t pubkey;
- pubkey = curve25519_public_key_info_encode(this->pubkey);
+ pubkey = public_key_info_encode(this->pubkey, OID_ED25519);
public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ED25519,
BUILD_BLOB_ASN1_DER, pubkey, BUILD_END);
free(pubkey.ptr);
{
bool success = TRUE;
- *encoding = curve25519_public_key_info_encode(this->pubkey);
+ *encoding = public_key_info_encode(this->pubkey, OID_ED25519);
if (type != PUBKEY_SPKI_ASN1_DER)
{
return &this->public;
}
-/**
- * See header.
- */
-chunk_t curve25519_public_key_info_encode(chunk_t pubkey)
-{
- return asn1_wrap(ASN1_SEQUENCE, "mm",
- asn1_wrap(ASN1_SEQUENCE, "m",
- asn1_build_known_oid(OID_ED25519)),
- asn1_bitstring("c", pubkey));
-}
-
/**
* See header.
*/
key = chunk_clone(pubkey);
break;
case KEYID_PUBKEY_INFO_SHA1:
- key = curve25519_public_key_info_encode(pubkey);
+ key = public_key_info_encode(pubkey, OID_ED25519);
break;
default:
return FALSE;