|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.licel.jcardsim.crypto.KeyImpl
com.licel.jcardsim.crypto.ECKeyImpl
com.licel.jcardsim.crypto.ECPrivateKeyImpl
public class ECPrivateKeyImpl
Implementation ECPrivateKey based
on BouncyCastle CryptoAPI
ECPrivateKey,
ECPrivateKeyParameters| Field Summary | |
|---|---|
protected ByteContainer |
s
|
| Fields inherited from class com.licel.jcardsim.crypto.ECKeyImpl |
|---|
a, b, e1, e2, e3, fp, g, isKInitialized, k, r |
| Fields inherited from class com.licel.jcardsim.crypto.KeyImpl |
|---|
size, type |
| Constructor Summary | |
|---|---|
ECPrivateKeyImpl(byte keyType,
short keySize)
Construct not-initialized ecc private key |
|
ECPrivateKeyImpl(org.bouncycastle.crypto.params.ECPrivateKeyParameters params)
Construct and initialize ecc key with ECPrivateKeyParameters. |
|
| Method Summary | |
|---|---|
void |
clearKey()
Clears the key and sets its initialized state to false. |
org.bouncycastle.crypto.CipherParameters |
getParameters()
Get ECPrivateKeyParameters |
short |
getS(byte[] buffer,
short offset)
Returns the value of the secret key in plaintext form. |
boolean |
isInitialized()
Reports the initialized state of the key. |
void |
setS(byte[] buffer,
short offset,
short length)
Sets the value of the secret key. |
| Methods inherited from class com.licel.jcardsim.crypto.ECKeyImpl |
|---|
getA, getB, getDomainParameters, getField, getG, getK, getKeyGenerationParameters, getR, setA, setB, setFieldF2M, setFieldF2M, setFieldFP, setG, setK, setR |
| 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 |
| Methods inherited from interface javacard.security.Key |
|---|
getSize, getType |
| Methods inherited from interface javacard.security.ECKey |
|---|
getA, getB, getField, getG, getK, getR, setA, setB, setFieldF2M, setFieldF2M, setFieldFP, setG, setK, setR |
| Field Detail |
|---|
protected ByteContainer s
| Constructor Detail |
|---|
public ECPrivateKeyImpl(byte keyType,
short keySize)
size - key size it bitsKeyBuilderpublic ECPrivateKeyImpl(org.bouncycastle.crypto.params.ECPrivateKeyParameters params)
params - key params from BouncyCastle APIKeyPair,
ECPrivateKeyParameters| Method Detail |
|---|
public void setS(byte[] buffer,
short offset,
short length)
throws CryptoException
ECPrivateKeyNote:
javacardx.crypto.KeyEncryption
interface and the Cipher object specified via setKeyCipher()
is not null, the key value is decrypted using the Cipher object.
setS in interface ECPrivateKeybuffer - the input bufferoffset - the offset into the input buffer at which the
secret value is to beginlength - the byte length of the secret value
CryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the input key data is inconsistent
with the key length or if input data decryption is required and fails.
public short getS(byte[] buffer,
short offset)
throws CryptoException
ECPrivateKey
getS in interface ECPrivateKeybuffer - the output bufferoffset - the offset into the input buffer at which the
secret value is to begin
CryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if the value of the secret key
has not been
successfully initialized since the
time the initialized state of the key was set to false.
Keypublic boolean isInitialized()
KeyA 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 KeyisInitialized in class ECKeyImpltrue if the key has been initializedpublic void clearKey()
Key
public org.bouncycastle.crypto.CipherParameters getParameters()
ECPrivateKeyParameters
getParameters in interface KeyWithParametersECPrivateKeyParameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||