RSA_GetPublicKey, RSA_GetPrivateKeyType1, RSA_GetPrivateKeyType2
RSA_GetPublicKey, RSA_GetPrivateKeyType1, RSA_GetPrivateKeyType2
Extracts key components from an RSA key context.
Syntax
IppStatus ippsRSA_GetPublicKey(IppsBigNumState*
pModulus
, IppsBigNumState*
pPublicExp
, const IppsRSAPublicKeyState*
pKey
);
IppStatus ippsRSA_GetPrivateKeyType1(IppsBigNumState*
pModulus
, IppsBigNumState*
pPrivateExp
, const IppsRSAPrivateKeyState*
pKey
);
IppStatus ippsRSA_GetPrivateKeyType2(IppsBigNumState*
pFactorP
, IppsBigNumState*
pFactorQ
, IppsBigNumState*
pCrtExpP
, IppsBigNumState*
pCrtExpQ
, IppsBigNumState*
pInverseQ
, const IppsRSAPrivateKeyState*
pKey
);
Include Files
ippcp.h
Parameters
- pModulus
- The composite RSA modulusn.
- pPublicExp
- Theecomponent of the RSA public key.
- pPrivateExp
- Thedcomponent of the type 1 RSA private key.
- pFactorP,pFactorQ
- Thepandqfactors of the RSA modulusn=p*q.
- pCrtExpP,pCrtExpQ
- ThedPanddQcomponents of the quintuple (p,q,dP,dQ,qInv).
- pInverseQ
- TheqInvcomponent of the quintuple (p,q,dP,dQ,qInv).
- pKey
- Pointer to theIppsRSAPublicKeyStateorIppsRSAPrivateKeyStatecontext.
Description
The
RSA_GetPublicKey
function extracts components of the RSA public key (n
, e
) from the IppsRSAPublicKeyState
context. The RSA_GetPrivateKeyType1
and RSA_GetPrivateKeyType2
functions extract components of the RSA private key of the respective type from the IppsRSAPrivateKeyState
context. To extract key components selectively, set pointers to the key components that do not need to be extracted to
NULL
.Return Values
- ippStsNoErr
- Indicates no error. Any other value indicates an error or warning.
- ippStsNullPtrErr
- Indicates an error condition if any of the specified pointers isNULL.
- ippStsContextMatchErr
- Indicates an error condition if any of the context parameters does not match the operation.
- ippStsSizeErr
- Indicates an error condition if the bit length of any specified key component is not sufficient to hold the value.
- ippStsIncompleteContextErr
- Indicates an error condition if the public or private key is not set up.While you can set up the public key or type 1 private key in a call toRSA_SetPublicKeyorRSA_SetPrivateKeyType1, respectively, you can set up the type 2 private key in a call to eitherRSA_SetPrivateKeyType2orRSA_GenerateKeys.