Previous: Abstract private keys, Up: Abstract key types [Contents][Index]
The abstract key types can be used to access signing and signature verification operations with the underlying keys.
pubkey: Holds the public key
algo: The signature algorithm used
flags: should be 0 for now
data: holds the signed data
signature: contains the signature
This function will verify the given signed data, using the parameters from the certificate.
Returns: In case of a verification failure GNUTLS_E_PK_SIG_VERIFY_FAILED
is returned, and zero or positive code on success.
Since: 3.0
key: Holds the public key
algo: The signature algorithm used
flags: should be 0 for now
hash: holds the hash digest to be verified
signature: contains the signature
This function will verify the given signed digest, using the parameters from the public key.
Returns: In case of a verification failure GNUTLS_E_PK_SIG_VERIFY_FAILED
is returned, and zero or positive code on success.
Since: 3.0
key: Holds the public key
flags: should be 0 for now
plaintext: The data to be encrypted
ciphertext: contains the encrypted data
This function will encrypt the given data, using the public key.
Returns: On success, GNUTLS_E_SUCCESS
(0) is returned, otherwise a
negative error value.
Since: 3.0
signer: Holds the key
hash: should be a digest algorithm
flags: should be 0 for now
data: holds the data to be signed
signature: will contain the signature allocate with gnutls_malloc()
This function will sign the given data using a signature algorithm supported by the private key. Signature algorithms are always used together with a hash functions. Different hash functions may be used for the RSA algorithm, but only the SHA family for the DSA keys.
You may use gnutls_pubkey_get_preferred_hash_algorithm()
to determine
the hash algorithm.
Returns: On success, GNUTLS_E_SUCCESS
(0) is returned, otherwise a
negative error value.
Since: 2.12.0
signer: Holds the signer’s key
hash_algo: The hash algorithm used
flags: zero for now
hash_data: holds the data to be signed
signature: will contain newly allocated signature
This function will sign the given hashed data using a signature algorithm supported by the private key. Signature algorithms are always used together with a hash functions. Different hash functions may be used for the RSA algorithm, but only SHA-XXX for the DSA keys.
You may use gnutls_pubkey_get_preferred_hash_algorithm()
to determine
the hash algorithm.
Returns: On success, GNUTLS_E_SUCCESS
(0) is returned, otherwise a
negative error value.
Since: 2.12.0
key: Holds the key
flags: zero for now
ciphertext: holds the data to be decrypted
plaintext: will contain the decrypted data, allocated with gnutls_malloc()
This function will decrypt the given data using the algorithm supported by the private key.
Returns: On success, GNUTLS_E_SUCCESS
(0) is returned, otherwise a
negative error value.
Since: 2.12.0
Signing existing structures, such as certificates, CRLs, or certificate requests, as well as associating public keys with structures is also possible using the key abstractions.
crq: should contain a gnutls_x509_crq_t
structure
key: holds a public key
This function will set the public parameters from the given public key to the request.
Returns: On success, GNUTLS_E_SUCCESS
(0) is returned, otherwise a
negative error value.
Since: 2.12.0
crt: should contain a gnutls_x509_crt_t
structure
key: holds a public key
This function will set the public parameters from the given public key to the request.
Returns: On success, GNUTLS_E_SUCCESS
(0) is returned, otherwise a
negative error value.
Since: 2.12.0
int gnutls_x509_crt_privkey_sign (gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key, gnutls_digest_algorithm_t dig, unsigned int flags)
int gnutls_x509_crl_privkey_sign (gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer, gnutls_privkey_t issuer_key, gnutls_digest_algorithm_t dig, unsigned int flags)
int gnutls_x509_crq_privkey_sign (gnutls_x509_crq_t crq, gnutls_privkey_t key, gnutls_digest_algorithm_t dig, unsigned int flags)
Previous: Abstract private keys, Up: Abstract key types [Contents][Index]