public class RSAKeyImpl extends KeyImpl implements javacard.security.RSAPrivateKey, javacard.security.RSAPublicKey
RSAPublic/RSAPrivate based on BouncyCastle CryptoAPI.RSAPrivateKey,
RSAPublicKey,
RSAKeyParameters| Modifier and Type | Field and Description |
|---|---|
protected ByteContainer |
exponent |
protected boolean |
isPrivate |
protected ByteContainer |
modulus |
| Constructor and Description |
|---|
RSAKeyImpl(boolean isPrivate,
short size)
Construct not-initialized rsa key
|
RSAKeyImpl(org.bouncycastle.crypto.params.RSAKeyParameters params)
Construct and initialize rsa key with RSAKeyParameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearKey() |
short |
getExponent(byte[] buffer,
short offset) |
org.bouncycastle.crypto.KeyGenerationParameters |
getKeyGenerationParameters(SecureRandom rnd)
Get
RSAKeyGenerationParameters |
short |
getModulus(byte[] buffer,
short offset) |
org.bouncycastle.crypto.CipherParameters |
getParameters()
Get
RSAKeyParameters |
boolean |
isInitialized() |
void |
setExponent(byte[] buffer,
short offset,
short length) |
void |
setModulus(byte[] buffer,
short offset,
short length) |
void |
setParameters(org.bouncycastle.crypto.CipherParameters params)
Set cipher key for use with BouncyCastle Crypto API
|
protected ByteContainer exponent
protected ByteContainer modulus
protected boolean isPrivate
public RSAKeyImpl(boolean isPrivate,
short size)
isPrivate - true if private keysize - key size it bits (modulus size)KeyBuilderpublic RSAKeyImpl(org.bouncycastle.crypto.params.RSAKeyParameters params)
params - key params from BouncyCastle APIKeyPair,
RSAKeyParameterspublic void setParameters(org.bouncycastle.crypto.CipherParameters params)
KeyWithParameterssetParameters in interface KeyWithParametersparams - key parameterspublic short getExponent(byte[] buffer,
short offset)
getExponent in interface javacard.security.RSAPrivateKeygetExponent in interface javacard.security.RSAPublicKeypublic short getModulus(byte[] buffer,
short offset)
getModulus in interface javacard.security.RSAPrivateKeygetModulus in interface javacard.security.RSAPublicKeypublic void setExponent(byte[] buffer,
short offset,
short length)
throws javacard.security.CryptoException
setExponent in interface javacard.security.RSAPrivateKeysetExponent in interface javacard.security.RSAPublicKeyjavacard.security.CryptoExceptionpublic void setModulus(byte[] buffer,
short offset,
short length)
throws javacard.security.CryptoException
setModulus in interface javacard.security.RSAPrivateKeysetModulus in interface javacard.security.RSAPublicKeyjavacard.security.CryptoExceptionpublic void clearKey()
clearKey in interface javacard.security.Keypublic boolean isInitialized()
isInitialized in interface javacard.security.Keypublic org.bouncycastle.crypto.CipherParameters getParameters()
RSAKeyParametersgetParameters in interface KeyWithParametersRSAKeyParameterspublic org.bouncycastle.crypto.KeyGenerationParameters getKeyGenerationParameters(SecureRandom rnd)
RSAKeyGenerationParametersgetKeyGenerationParameters in interface KeyWithParametersrnd - Secure Random Generator