|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.licel.jcardsim.crypto.KeyImpl com.licel.jcardsim.crypto.DSAKeyImpl
Base class for DSAPublicKeyImpl/DSAPrivateKeyImpl
on BouncyCastle CryptoAPI
DSAKey
Field Summary | |
---|---|
protected ByteContainer |
g
|
protected boolean |
isPrivate
|
protected ByteContainer |
p
|
protected ByteContainer |
q
|
Fields inherited from class com.licel.jcardsim.crypto.KeyImpl |
---|
size, type |
Constructor Summary | |
---|---|
DSAKeyImpl(byte keyType,
short size)
Construct not-initialized dsa key |
|
DSAKeyImpl(org.bouncycastle.crypto.params.DSAKeyParameters params)
Construct and initialize dsa key with DSAKeyParameters. |
Method Summary | |
---|---|
void |
clearKey()
Clears the key and sets its initialized state to false. |
short |
getG(byte[] buffer,
short offset)
Returns the base parameter value of the key in plain text. |
org.bouncycastle.crypto.KeyGenerationParameters |
getKeyGenerationParameters(SecureRandom rnd)
Get DSAKeyGenerationParameters |
short |
getP(byte[] buffer,
short offset)
Returns the prime parameter value of the key in plain text. |
org.bouncycastle.crypto.CipherParameters |
getParameters()
Get DSAKeyParameters |
short |
getQ(byte[] buffer,
short offset)
Returns the subprime parameter value of the key in plain text. |
boolean |
isInitialized()
Reports the initialized state of the key. |
void |
setG(byte[] buffer,
short offset,
short length)
Sets the base parameter value of the key. |
void |
setP(byte[] buffer,
short offset,
short length)
Sets the prime parameter value of the key. |
void |
setQ(byte[] buffer,
short offset,
short length)
Sets the subprime parameter value of the key. |
Methods inherited from class com.licel.jcardsim.crypto.KeyImpl |
---|
getSize, getType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ByteContainer p
protected ByteContainer q
protected ByteContainer g
protected boolean isPrivate
Constructor Detail |
---|
public DSAKeyImpl(byte keyType, short size)
keyType
- - key typekeySize
- - key size in bitsKeyPair
,
KeyBuilder
public DSAKeyImpl(org.bouncycastle.crypto.params.DSAKeyParameters params)
KeyPair
,
DSAKeyParameters
Method Detail |
---|
public void clearKey()
Key
public boolean isInitialized()
Key
A Key
object sets its initialized state to true only when all the associated
Key
object parameters have been set at least once since the time the initialized state was set to false.
A newly created Key
object sets its initialized state to false. Invocation of the
clearKey()
method sets the initialized state to false. A key with transient key data
sets its initialized state to false on the associated clear events.
isInitialized
in interface Key
true
if the key has been initializedpublic void setP(byte[] buffer, short offset, short length) throws CryptoException
DSAKey
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the prime parameter value is decrypted using the Cipher
object.
buffer
- the input bufferoffset
- the offset into the input buffer at which the prime parameter value beginslength
- the length of the prime parameter value
CryptoException
- with the following reason code:
CryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
public void setQ(byte[] buffer, short offset, short length) throws CryptoException
DSAKey
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the subprime parameter value is decrypted using the Cipher
object.
buffer
- the input bufferoffset
- the offset into the input buffer at which the subprime parameter value beginslength
- the length of the subprime parameter value
CryptoException
- with the following reason code:
CryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
public void setG(byte[] buffer, short offset, short length) throws CryptoException
DSAKey
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, the base parameter value is decrypted using the Cipher
object.
buffer
- the input bufferoffset
- the offset into the input buffer at which the base parameter value beginslength
- the length of the base parameter value
CryptoException
- with the following reason code:
CryptoException.ILLEGAL_VALUE
if the input parameter data length is inconsistent
with the implementation or if input data decryption is required and fails.
public short getP(byte[] buffer, short offset)
DSAKey
buffer
- the output bufferoffset
- the offset into the output buffer at which the prime parameter value starts
Key
public short getQ(byte[] buffer, short offset)
DSAKey
buffer
- the output bufferoffset
- the offset into the output buffer at which the subprime parameter value begins
Key
public short getG(byte[] buffer, short offset)
DSAKey
buffer
- the output bufferoffset
- the offset into the output buffer at which the base parameter value begins
Key
public org.bouncycastle.crypto.CipherParameters getParameters()
DSAKeyParameters
getParameters
in interface KeyWithParameters
DSAKeyParameters
public org.bouncycastle.crypto.KeyGenerationParameters getKeyGenerationParameters(SecureRandom rnd)
DSAKeyGenerationParameters
getKeyGenerationParameters
in interface KeyWithParameters
rnd
- Secure Random Generator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |