x509_sign_format.c File Reference
#include "core/crypto.h"
#include "pkix/x509_sign_format.h"
#include "pkix/x509_sign_generate.h"
#include "encoding/asn1.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

error_t x509FormatSignatureAlgo (const X509SignAlgoId *signatureAlgo, uint8_t *output, size_t *written)
 Format SignatureAlgorithm structure. More...
 
error_t x509FormatSignatureValue (const PrngAlgo *prngAlgo, void *prngContext, const X509OctetString *tbsCert, const X509SignAlgoId *signAlgoId, const X509SubjectPublicKeyInfo *publicKeyInfo, const void *privateKey, uint8_t *output, size_t *written)
 Format SignatureValue field. More...
 
error_t x509FormatRsaPssParameters (const X509RsaPssParameters *rsaPssParams, uint8_t *output, size_t *written)
 Format RSASSA-PSS parameters. More...
 
error_t x509FormatRsaPssHashAlgo (const X509RsaPssParameters *rsaPssParams, uint8_t *output, size_t *written)
 Format RSASSA-PSS hash algorithm. More...
 
error_t x509FormatRsaPssMaskGenAlgo (const X509RsaPssParameters *rsaPssParams, uint8_t *output, size_t *written)
 Format RSASSA-PSS mask generation algorithm. More...
 
error_t x509FormatRsaPssMaskGenHashAlgo (const X509RsaPssParameters *rsaPssParams, uint8_t *output, size_t *written)
 Format RSASSA-PSS mask generation hash algorithm. More...
 
error_t x509FormatRsaPssSaltLength (const X509RsaPssParameters *rsaPssParams, uint8_t *output, size_t *written)
 Format RSASSA-PSS salt length. More...
 

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file x509_sign_format.c.

Function Documentation

◆ x509FormatRsaPssHashAlgo()

error_t x509FormatRsaPssHashAlgo ( const X509RsaPssParameters rsaPssParams,
uint8_t *  output,
size_t *  written 
)

Format RSASSA-PSS hash algorithm.

Parameters
[in]rsaPssParamsPointer to the RSA-PSS parameters
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 338 of file x509_sign_format.c.

◆ x509FormatRsaPssMaskGenAlgo()

error_t x509FormatRsaPssMaskGenAlgo ( const X509RsaPssParameters rsaPssParams,
uint8_t *  output,
size_t *  written 
)

Format RSASSA-PSS mask generation algorithm.

Parameters
[in]rsaPssParamsPointer to the RSA-PSS parameters
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 408 of file x509_sign_format.c.

◆ x509FormatRsaPssMaskGenHashAlgo()

error_t x509FormatRsaPssMaskGenHashAlgo ( const X509RsaPssParameters rsaPssParams,
uint8_t *  output,
size_t *  written 
)

Format RSASSA-PSS mask generation hash algorithm.

Parameters
[in]rsaPssParamsPointer to the RSA-PSS parameters
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 497 of file x509_sign_format.c.

◆ x509FormatRsaPssParameters()

error_t x509FormatRsaPssParameters ( const X509RsaPssParameters rsaPssParams,
uint8_t *  output,
size_t *  written 
)

Format RSASSA-PSS parameters.

Parameters
[in]rsaPssParamsPointer to the RSA-PSS parameters
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 265 of file x509_sign_format.c.

◆ x509FormatRsaPssSaltLength()

error_t x509FormatRsaPssSaltLength ( const X509RsaPssParameters rsaPssParams,
uint8_t *  output,
size_t *  written 
)

Format RSASSA-PSS salt length.

Parameters
[in]rsaPssParamsPointer to the RSA-PSS parameters
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 555 of file x509_sign_format.c.

◆ x509FormatSignatureAlgo()

error_t x509FormatSignatureAlgo ( const X509SignAlgoId signatureAlgo,
uint8_t *  output,
size_t *  written 
)

Format SignatureAlgorithm structure.

Parameters
[in]signatureAlgoPointer to the SignatureAlgorithm structure
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 53 of file x509_sign_format.c.

◆ x509FormatSignatureValue()

error_t x509FormatSignatureValue ( const PrngAlgo prngAlgo,
void *  prngContext,
const X509OctetString tbsCert,
const X509SignAlgoId signAlgoId,
const X509SubjectPublicKeyInfo publicKeyInfo,
const void *  privateKey,
uint8_t *  output,
size_t *  written 
)

Format SignatureValue field.

Parameters
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
[in]tbsCertPointer to the TBSCertificate to be signed
[in]signAlgoIdSignature algorithm identifier
[in]publicKeyInfoSigner's public key information
[in]privateKeySigner's private key
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 215 of file x509_sign_format.c.