|
||||||||||
| 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.ECPublicKeyImpl
public class ECPublicKeyImpl
Implementation ECPublicKey based
on BouncyCastle CryptoAPI
ECPublicKey,
ECPublicKeyParameters| Field Summary | |
|---|---|
protected ByteContainer |
w
|
| 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 | |
|---|---|
ECPublicKeyImpl(byte keyType,
short keySize)
Construct not-initialized ecc public key |
|
ECPublicKeyImpl(org.bouncycastle.crypto.params.ECPublicKeyParameters params)
Construct and initialize ecc key with ECPublicKeyParameters. |
|
| Method Summary | |
|---|---|
void |
clearKey()
Clears the key and sets its initialized state to false. |
org.bouncycastle.crypto.CipherParameters |
getParameters()
Get ECPublicKeyParameters |
short |
getW(byte[] buffer,
short offset)
Returns the point of the curve comprising the public key in plain text form. |
boolean |
isInitialized()
Reports the initialized state of the key. |
void |
setW(byte[] buffer,
short offset,
short length)
Sets the point of the curve comprising the public 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 w
| Constructor Detail |
|---|
public ECPublicKeyImpl(byte keyType,
short keySize)
size - key size it bitsKeyBuilderpublic ECPublicKeyImpl(org.bouncycastle.crypto.params.ECPublicKeyParameters params)
params - key params from BouncyCastle APIKeyPair,
ECPublicKeyParameters| Method Detail |
|---|
public void setW(byte[] buffer,
short offset,
short length)
throws CryptoException
ECPublicKeyNote:
javacardx.crypto.KeyEncryption
interface and the Cipher object specified via setKeyCipher()
is not null, the key value is decrypted using the Cipher object.
setW in interface ECPublicKeybuffer - the input bufferoffset - the offset into the input buffer at which the
point specification beginslength - the byte length of the point specification
CryptoException - with the following reason code:
CryptoException.ILLEGAL_VALUE if the input parameter
data format is incorrect, or if the input parameter data is inconsistent with the key length,
or if input data decryption is required and fails.
public short getW(byte[] buffer,
short offset)
throws CryptoException
ECPublicKey
getW in interface ECPublicKeybuffer - the output bufferoffset - the offset into the output buffer at which the
point specification data is to begin
CryptoException - with the following reason code:
CryptoException.UNINITIALIZED_KEY if the point of the curve
comprising the public 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
clearKey in interface KeyclearKey in class ECKeyImplpublic org.bouncycastle.crypto.CipherParameters getParameters()
ECPublicKeyParameters
getParameters in interface KeyWithParametersECPublicKeyParameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||