The EVP_PKEY structure will be initialised without any private key information. Algorithm types that support raw public keys are "X25519", "ED25519", "X448" or "ED448".ĮVP_PKEY_new_raw_public_key() works in the same way as EVP_PKEY_new_raw_private_key() except that key points to the raw public key data. This usage is, as mentioned above, discouraged in favor of the EVP_MAC(3) API.ĮVP_PKEY_new_raw_public_key_ex() works in the same way as EVP_PKEY_new_raw_private_key_ex() except that key points to the raw public key data. one of EVP_PKEY_X25519, EVP_PKEY_ED25519, EVP_PKEY_X448 or EVP_PKEY_ED448.ĮVP_PKEY_new_raw_private_key_ex() and EVP_PKEY_new_raw_private_key() may also be used with most MACs implemented as public key algorithms, so key types such as "HMAC", "POLY1305", "SIPHASH", or their NID form EVP_PKEY_POLY1305, EVP_PKEY_SIPHASH, EVP_PKEY_HMAC are also accepted. The value should be a NID for a public key algorithm that supports raw private keys, i.e. The type argument indicates what kind of key this is. If e is non-NULL then the new EVP_PKEY structure is associated with the engine e. The public key data will be automatically derived from the given private key data (if appropriate for the algorithm type).ĮVP_PKEY_new_raw_private_key() does the same as EVP_PKEY_new_raw_private_key_ex() except that the default library context and default property query are used instead. The length should be appropriate for the type of the key. key points to the raw private key data for this EVP_PKEY which should be of length keylen. The value should be a string for a public key algorithm that supports raw private keys, i.e one of "X25519", "ED25519", "X448" or "ED448". The keytype argument indicates what kind of key this is. Unless an engine should be used for the key type, a provider for the key is found using the library context libctx and the property query string propq. If key is NULL, nothing is done.ĮVP_PKEY_new_raw_private_key_ex() allocates a new EVP_PKEY. The key must not be ENGINE based or a raw key, otherwise the duplication will fail.ĮVP_PKEY_free() decrements the reference count of key and, if the reference count is zero, frees it up. The reference count is set to 1.ĮVP_PKEY_up_ref() increments the reference count of key.ĮVP_PKEY_dup() duplicates the key. The EVP_PKEY_new() function allocates an empty EVP_PKEY structure which is used by OpenSSL to store public and private keys. This usage is considered legacy and is discouraged in favor of the EVP_MAC(3) API. The presence of these components determine what operations can be made for example, signing normally requires the presence of a private key, and verifying normally requires the presence of a public key.ĮVP_PKEY has also been used for MAC algorithm that were conceived as producing signatures, although not being public key algorithms "POLY1305", "SIPHASH", "HMAC", "CMAC". The asymmetric keys themselves are often referred to as the "internal key", and are handled by backends, such as providers (through EVP_KEYMGMT(3)) or ENGINEs.Ĭonceptually, an EVP_PKEY internal key may hold a private key, a public key, or both (a keypair), and along with those, key parameters if the key type requires them. Size_t len, const EVP_CIPHER *cipher) DESCRIPTIONĮVP_PKEY is a generic structure to hold diverse types of asymmetric keys (also known as "key pairs"), and can be used for diverse operations, like signing, verifying signatures, key derivation, etc. The following function has been deprecated since OpenSSL 3.0, and can be hidden entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7): EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, Int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub, Int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv, EVP_PKEY, EVP_PKEY_new, EVP_PKEY_up_ref, EVP_PKEY_dup, EVP_PKEY_free, EVP_PKEY_new_raw_private_key_ex, EVP_PKEY_new_raw_private_key, EVP_PKEY_new_raw_public_key_ex, EVP_PKEY_new_raw_public_key, EVP_PKEY_new_CMAC_key, EVP_PKEY_new_mac_key, EVP_PKEY_get_raw_private_key, EVP_PKEY_get_raw_public_key - public/private key allocation and raw key handling functions SYNOPSIS #include ĮVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,ĮVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,Ĭonst unsigned char *key, size_t keylen) ĮVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,ĮVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,ĮVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, const unsigned char *key,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |