Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/contrib/lax_der_privatekey_parsing.h
Show All 19 Lines | |||||
* manner. | * manner. | ||||
* | * | ||||
* These functions are meant for compatibility with applications | * These functions are meant for compatibility with applications | ||||
* that require BER encoded keys. When working with secp256k1-specific | * that require BER encoded keys. When working with secp256k1-specific | ||||
* code, the simple 32-byte private keys normally used by the | * code, the simple 32-byte private keys normally used by the | ||||
* library are sufficient. | * library are sufficient. | ||||
*/ | */ | ||||
#ifndef _SECP256K1_CONTRIB_BER_PRIVATEKEY_H_ | #ifndef SECP256K1_CONTRIB_BER_PRIVATEKEY_H | ||||
#define _SECP256K1_CONTRIB_BER_PRIVATEKEY_H_ | #define SECP256K1_CONTRIB_BER_PRIVATEKEY_H | ||||
#include <secp256k1.h> | #include <secp256k1.h> | ||||
# ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
# endif | #endif | ||||
/** Export a private key in DER format. | /** Export a private key in DER format. | ||||
* | * | ||||
* Returns: 1 if the private key was valid. | * Returns: 1 if the private key was valid. | ||||
* Args: ctx: pointer to a context object, initialized for signing (cannot | * Args: ctx: pointer to a context object, initialized for signing (cannot | ||||
* be NULL) | * be NULL) | ||||
* Out: privkey: pointer to an array for storing the private key in BER. | * Out: privkey: pointer to an array for storing the private key in BER. | ||||
* Should have space for 279 bytes, and cannot be NULL. | * Should have space for 279 bytes, and cannot be NULL. | ||||
Show All 38 Lines | SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der( | ||||
const unsigned char *privkey, | const unsigned char *privkey, | ||||
size_t privkeylen | size_t privkeylen | ||||
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3); | ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
#endif | #endif /* SECP256K1_CONTRIB_BER_PRIVATEKEY_H */ |