iPXE
pubkey_algorithm Struct Reference

A public key algorithm. More...

#include <crypto.h>

Data Fields

const char * name
 Algorithm name.
int(* encrypt )(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)
 Encrypt.
int(* decrypt )(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)
 Decrypt.
int(* sign )(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, struct asn1_builder *builder)
 Sign digest value.
int(* verify )(struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, struct digest_algorithm *digest, const void *value, const struct asn1_cursor *signature)
 Verify signed digest value.
int(* match )(struct pubkey_algorithm *pubkey, const struct asn1_cursor *private_key, const struct asn1_cursor *public_key)
 Check that public key matches private key.
void * priv
 Algorithm private data.

Detailed Description

A public key algorithm.

Definition at line 142 of file crypto.h.

Field Documentation

◆ name

const char* pubkey_algorithm::name

Algorithm name.

Definition at line 144 of file crypto.h.

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

◆ encrypt

int(* pubkey_algorithm::encrypt) (struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *plaintext, struct asn1_builder *ciphertext)

Encrypt.

Parameters
pubkeyPublic key algorithm
keyKey
plaintextPlaintext
ciphertextCiphertext
Return values
rcReturn status code

Definition at line 153 of file crypto.h.

Referenced by pubkey_encrypt().

◆ decrypt

int(* pubkey_algorithm::decrypt) (struct pubkey_algorithm *pubkey, const struct asn1_cursor *key, const struct asn1_cursor *ciphertext, struct asn1_builder *plaintext)

Decrypt.

Parameters
pubkeyPublic key algorithm
keyKey
ciphertextCiphertext
plaintextPlaintext
Return values
rcReturn status code

Definition at line 165 of file crypto.h.

Referenced by pubkey_decrypt().

◆ sign

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

Sign digest value.

Parameters
pubkeyPublic key algorithm
keyKey
digestDigest algorithm
valueDigest value
signatureSignature
Return values
rcReturn status code

Definition at line 178 of file crypto.h.

Referenced by pubkey_sign().

◆ verify

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

Verify signed digest value.

Parameters
pubkeyPublic key algorithm
keyKey
digestDigest algorithm
valueDigest value
signatureSignature
Return values
rcReturn status code

Definition at line 191 of file crypto.h.

Referenced by pubkey_verify().

◆ match

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

Check that public key matches private key.

Parameters
pubkeyPublic key algorithm
private_keyPrivate key
public_keyPublic key
Return values
rcReturn status code

Definition at line 202 of file crypto.h.

Referenced by pubkey_match().

◆ priv

void* pubkey_algorithm::priv

Algorithm private data.

Definition at line 206 of file crypto.h.

Referenced by rsa_sign(), and rsa_verify().


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