Store and parse BLISS private and public keys in DER and PEM format
Additionally generate SHA-1 fingerprints of raw BLISS subjectPublicKey and subjectPublicKeyInfo objects. Some basic functions used by the bliss_public_key class are shared with the bliss_private_key class.
This commit is contained in:
@@ -53,6 +53,11 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cred_encoding_args(args, CRED_PART_BLISS_PUB_ASN1_DER,
|
||||
&asn1, CRED_PART_END))
|
||||
{
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
case PRIVKEY_PEM:
|
||||
label ="RSA PRIVATE KEY";
|
||||
@@ -86,6 +91,12 @@ bool pem_encoder_encode(cred_encoding_type_t type, chunk_t *encoding,
|
||||
label ="EC PRIVATE KEY";
|
||||
break;
|
||||
}
|
||||
if (cred_encoding_args(args, CRED_PART_BLISS_PRIV_ASN1_DER,
|
||||
&asn1, CRED_PART_END))
|
||||
{
|
||||
label ="BLISS PRIVATE KEY";
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
case CERT_PEM:
|
||||
if (cred_encoding_args(args, CRED_PART_X509_ASN1_DER,
|
||||
|
||||
@@ -60,6 +60,9 @@ METHOD(plugin_t, get_features, int,
|
||||
PLUGIN_PROVIDE(PRIVKEY, KEY_DSA),
|
||||
PLUGIN_DEPENDS(PRIVKEY, KEY_DSA),
|
||||
PLUGIN_SDEPEND(HASHER, HASH_MD5),
|
||||
PLUGIN_REGISTER(PRIVKEY, pem_private_key_load, FALSE),
|
||||
PLUGIN_PROVIDE(PRIVKEY, KEY_BLISS),
|
||||
PLUGIN_DEPENDS(PRIVKEY, KEY_BLISS),
|
||||
|
||||
/* public key PEM decoding */
|
||||
PLUGIN_REGISTER(PUBKEY, pem_public_key_load, FALSE),
|
||||
@@ -74,6 +77,8 @@ METHOD(plugin_t, get_features, int,
|
||||
PLUGIN_REGISTER(PUBKEY, pem_public_key_load, FALSE),
|
||||
PLUGIN_PROVIDE(PUBKEY, KEY_DSA),
|
||||
PLUGIN_DEPENDS(PUBKEY, KEY_DSA),
|
||||
PLUGIN_REGISTER(PUBKEY, pem_public_key_load, FALSE),
|
||||
PLUGIN_PROVIDE(PUBKEY, KEY_BLISS),
|
||||
|
||||
/* certificate PEM decoding */
|
||||
PLUGIN_REGISTER(CERT_DECODE, pem_certificate_load, FALSE),
|
||||
|
||||
Reference in New Issue
Block a user