Lines Matching refs:key

79 // EVP abstracts over public/private key algorithms.
82 // Public key objects.
84 // EVP_PKEY_new creates a new, empty public-key object and returns it or NULL
96 // custom implementations which do not expose key material and parameters. It is
97 // an error to attempt to duplicate, export, or compare an opaque key.
116 // |pkey|. For an RSA key, this returns the number of bytes needed to represent
117 // the modulus. For an EC key, this returns the maximum size of a DER-encoded
121 // EVP_PKEY_bits returns the "size", in bits, of |pkey|. For an RSA key, this
122 // returns the bit length of the modulus. For an EC key, this returns the bit
130 // EVP_PKEY_type returns |nid| if |nid| is a known key type and |NID_undef|
135 // Getting and setting concrete public key types.
137 // The following functions get and set the underlying public key in an
139 // underlying key and return one on success or zero on error. The |assign|
145 OPENSSL_EXPORT int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key);
146 OPENSSL_EXPORT int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key);
150 OPENSSL_EXPORT int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key);
151 OPENSSL_EXPORT int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key);
155 OPENSSL_EXPORT int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key);
156 OPENSSL_EXPORT int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key);
161 // Ed25519 public key, or NULL on allocation error.
166 // Ed25519 private key, or NULL on allocation error.
176 // EVP_PKEY_assign sets the underlying key of |pkey| to |key|, which must be of
179 OPENSSL_EXPORT int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
200 // The caller must check the type of the parsed public key to ensure it is
201 // suitable and validate other desired key properties such as RSA modulus size
205 // EVP_marshal_public_key marshals |key| as a DER-encoded SubjectPublicKeyInfo
208 OPENSSL_EXPORT int EVP_marshal_public_key(CBB *cbb, const EVP_PKEY *key);
214 // The caller must check the type of the parsed private key to ensure it is
215 // suitable and validate other desired key properties such as RSA modulus size
223 // EVP_marshal_private_key marshals |key| as a DER-encoded PrivateKeyInfo
226 OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key);
347 // |EVP_SignUpdate|, using the key |pkey|, and writes it to |sig|. On entry,
394 // EVP_PKEY_print_public prints a textual representation of the public key in
399 // EVP_PKEY_print_private prints a textual representation of the private key in
413 // function that results in a key suitable for use in symmetric
432 // EVP_PBE_scrypt expands |password| into a secret key of length |key_len| using
447 // Public key contexts.
450 // encrypting) that uses a public key.
456 // EVP_PKEY_CTX_new_id allocates a fresh |EVP_PKEY_CTX| for a key of type |id|
457 // (e.g. |EVP_PKEY_HMAC|). This can be used for key generation where
555 // EVP_PKEY_verify_recover_init initialises an |EVP_PKEY_CTX| for a public-key
558 // Public-key decryption is a very obscure operation that is only implemented
583 // EVP_PKEY_derive_init initialises an |EVP_PKEY_CTX| for a key derivation
590 // EVP_PKEY_derive_set_peer sets the peer's key to be used for key derivation
592 // example, this is used to set the peer's key in (EC)DH.) It returns one on
596 // EVP_PKEY_derive derives a shared key between the two keys configured in
597 // |ctx|. If |key| is non-NULL then, on entry, |out_key_len| must contain the
598 // amount of space at |key|. If sufficient then the shared key will be written
599 // to |key| and |*out_key_len| will be set to the length. If |key| is NULL then
602 // WARNING: Setting |out| to NULL only gives the maximum size of the key. The
603 // actual key may be smaller.
606 OPENSSL_EXPORT int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, uint8_t *key,
609 // EVP_PKEY_keygen_init initialises an |EVP_PKEY_CTX| for a key generation
615 // EVP_PKEY_keygen performs a key generation operation using the values from
616 // |ctx| and sets |*ppkey| to a fresh |EVP_PKEY| containing the resulting key.
668 // in bits, for key generation. Returns one on success or zero on
673 // EVP_PKEY_CTX_set_rsa_keygen_pubexp sets |e| as the public exponent for key
752 // i2d_PrivateKey marshals a private key from |key| to an ASN.1, DER
761 OPENSSL_EXPORT int i2d_PrivateKey(const EVP_PKEY *key, uint8_t **outp);
763 // i2d_PublicKey marshals a public key from |key| to a type-specific format.
772 OPENSSL_EXPORT int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp);
774 // d2i_PrivateKey parses an ASN.1, DER-encoded, private key from |len| bytes at
788 // of the private key.
831 // methods for the key type.