iPXE
Data Fields
pubkey_algorithm Struct Reference

A public key algorithm. More...

#include <crypto.h>

Data Fields

const char * name
 Algorithm name. More...
 
size_t(* max_len )(const struct asn1_cursor *key)
 Calculate maximum output length. More...
 
int(* encrypt )(const struct asn1_cursor *key, const void *data, size_t len, void *out)
 Encrypt. More...
 
int(* decrypt )(const struct asn1_cursor *key, const void *data, size_t len, void *out)
 Decrypt. More...
 
int(* sign )(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, void *signature)
 Sign digest value. More...
 
int(* verify )(const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len)
 Verify signed digest value. More...
 
int(* match )(const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
 Check that public key matches private key. More...
 

Detailed Description

A public key algorithm.

Definition at line 121 of file crypto.h.

Field Documentation

◆ name

const char* pubkey_algorithm::name

Algorithm name.

Definition at line 123 of file crypto.h.

Referenced by tls_select_cipher(), tls_send_certificate_verify(), and tls_verify_dh_params().

◆ max_len

size_t( * pubkey_algorithm::max_len) (const struct asn1_cursor *key)

Calculate maximum output length.

Parameters
keyKey
Return values
max_lenMaximum output length

Definition at line 129 of file crypto.h.

Referenced by pubkey_max_len(), pubkey_okx(), and tls_send_client_key_exchange_pubkey().

◆ encrypt

int( * pubkey_algorithm::encrypt) (const struct asn1_cursor *key, const void *data, size_t len, void *out)

Encrypt.

Parameters
keyKey
plaintextPlaintext
plaintext_lenLength of plaintext
ciphertextCiphertext
Return values
ciphertext_lenLength of ciphertext, or negative error

Definition at line 138 of file crypto.h.

Referenced by pubkey_encrypt().

◆ decrypt

int( * pubkey_algorithm::decrypt) (const struct asn1_cursor *key, const void *data, size_t len, void *out)

Decrypt.

Parameters
keyKey
ciphertextCiphertext
ciphertext_lenCiphertext length
plaintextPlaintext
Return values
plaintext_lenPlaintext length, or negative error

Definition at line 148 of file crypto.h.

Referenced by pubkey_decrypt().

◆ sign

int( * pubkey_algorithm::sign) (const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, void *signature)

Sign digest value.

Parameters
keyKey
digestDigest algorithm
valueDigest value
signatureSignature
Return values
signature_lenSignature length, or negative error

Definition at line 158 of file crypto.h.

Referenced by pubkey_sign().

◆ verify

int( * pubkey_algorithm::verify) (const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const void *signature, size_t signature_len)

Verify signed digest value.

Parameters
keyKey
digestDigest algorithm
valueDigest value
signatureSignature
signature_lenSignature length
Return values
rcReturn status code

Definition at line 170 of file crypto.h.

Referenced by pubkey_verify().

◆ match

int( * pubkey_algorithm::match) (const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)

Check that public key matches private key.

Parameters
private_keyPrivate key
public_keyPublic key
Return values
rcReturn status code

Definition at line 179 of file crypto.h.

Referenced by pubkey_match().


The documentation for this struct was generated from the following file: