implemented a pkcs1 plugin providing PKCS#1 key parsing builders

This commit is contained in:
Martin Willi
2009-08-26 11:23:50 +02:00
parent 750bbcf9a8
commit 1e0f69373a
10 changed files with 595 additions and 0 deletions
+8
View File
@@ -41,6 +41,14 @@ ENUM(builder_part_names, BUILD_FROM_FILE, BUILD_END,
"BUILD_X509_FLAG",
"BUILD_SMARTCARD_KEYID",
"BUILD_SMARTCARD_PIN",
"BUILD_RSA_MODULUS",
"BUILD_RSA_PUB_EXP",
"BUILD_RSA_PRIV_EXP",
"BUILD_RSA_PRIME1",
"BUILD_RSA_PRIME2",
"BUILD_RSA_EXP1",
"BUILD_RSA_EXP2",
"BUILD_RSA_COEFF",
"BUILD_END",
);
+16
View File
@@ -90,6 +90,22 @@ enum builder_part_t {
BUILD_SMARTCARD_KEYID,
/** pin to access a key on a smartcard, null terminated char* */
BUILD_SMARTCARD_PIN,
/** modulus (n) of a RSA key, chunk_t */
BUILD_RSA_MODULUS,
/** public exponent (e) of a RSA key, chunk_t */
BUILD_RSA_PUB_EXP,
/** private exponent (d) of a RSA key, chunk_t */
BUILD_RSA_PRIV_EXP,
/** prime 1 (p) of a RSA key, chunk_t */
BUILD_RSA_PRIME1,
/** prime 2 (q) of a RSA key, chunk_t */
BUILD_RSA_PRIME2,
/** exponent 1 (exp1) of a RSA key, chunk_t */
BUILD_RSA_EXP1,
/** exponent 2 (exp1) of a RSA key, chunk_t */
BUILD_RSA_EXP2,
/** coefficient (coeff) of a RSA key, chunk_t */
BUILD_RSA_COEFF,
/** end of variable argument builder list */
BUILD_END,
};
@@ -169,6 +169,14 @@ static void* create(private_credential_factory_t *this, credential_type_t type,
case BUILD_BLOB_RFC_3110:
case BUILD_PASSPHRASE:
case BUILD_SERIAL:
case BUILD_RSA_MODULUS:
case BUILD_RSA_PUB_EXP:
case BUILD_RSA_PRIV_EXP:
case BUILD_RSA_PRIME1:
case BUILD_RSA_PRIME2:
case BUILD_RSA_EXP1:
case BUILD_RSA_EXP2:
case BUILD_RSA_COEFF:
builder->add(builder, part, va_arg(args, chunk_t));
continue;
case BUILD_X509_FLAG: