#ifndef _OPEN_RSA_SNACC_H_
#define _OPEN_RSA_SNACC_H_
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/dh.h>
#include <Security/cssmtype.h>
#include <Security/cssmdata.h>
#include <Security/asn-incl.h>
#include <Security/sm_vdatypes.h>
#ifdef __cplusplus
extern "C" {
#endif
BIGNUM *bigIntStrToBn(
BigIntegerStr &snaccInt);
void bnToBigIntStr(
BIGNUM *bn,
BigIntegerStr &snaccInt);
unsigned sizeofBigInt(
BigIntegerStr &bigInt);
void snaccIntToBigIntegerStr(
int i,
BigIntegerStr &bigInt);
CSSM_RETURN RSAPublicKeyDecode(
RSA *openKey,
void *p,
size_t length);
CSSM_RETURN RSAPublicKeyEncode(
RSA *openKey,
CssmOwnedData &encodedKey);
CSSM_RETURN RSAPrivateKeyDecode(
RSA *openKey,
void *p,
size_t length);
CSSM_RETURN RSAPrivateKeyEncode(
RSA *openKey,
CssmOwnedData &encodedKey);
CSSM_RETURN generateDigestInfo(
const void *messageDigest,
size_t digestLen,
CSSM_ALGORITHMS digestAlg, CssmOwnedData &encodedInfo,
size_t maxEncodedSize);
CSSM_RETURN DSAPublicKeyDecode(
DSA *openKey,
unsigned char *p,
unsigned length);
CSSM_RETURN DSAPublicKeyEncode(
DSA *openKey,
CssmOwnedData &encodedKey);
CSSM_RETURN DSAPrivateKeyDecode(
DSA *openKey,
unsigned char *p,
unsigned length);
CSSM_RETURN DSAPrivateKeyEncode(
DSA *openKey,
CssmOwnedData &encodedKey);
CSSM_RETURN DSASigEncode(
DSA_SIG *openSig,
CssmOwnedData &encodedSig);
CSSM_RETURN DSASigDecode(
DSA_SIG *openSig,
const void *p,
unsigned length);
CSSM_RETURN DHPrivateKeyDecode(
DH *openKey,
unsigned char *p,
unsigned length);
CSSM_RETURN DHPrivateKeyEncode(
DH *openKey,
CssmOwnedData &encodedKey);
#ifdef __cplusplus
}
#endif
#endif