|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.crypto.KeyAgreementSpi iaik.security.ecc.ecdh.ECDH
DLSVDP-DH is Discrete Logarithm Secret Value Derivation Primitive, Diffie-Hellman version, compliant with IEEE 1363 and DLSVDP-DHC is Discrete Logarithm Secret Value Derivation Primitive, Diffie-Hellman version with cofactor multiplication.
This implementation doesn't perform a parameter check. Both, the private and the public key have to use the same parameter set.
Field Summary | |
protected ECDSAParams |
parameter_
The used parameter set. |
protected ECDSAPrivateKey |
privateKey_
The private key for this key agreement. |
protected byte[] |
secret_
The generated shared secret. |
protected boolean |
withCoFactor_
if true the algorithm uses cofactor multiplication. |
Constructor Summary | |
|
ECDH()
Constructor used by provider. |
protected |
ECDH(boolean withCoFactorMultiplication)
Creates a new ECDH instance.
|
Method Summary | |
protected java.security.Key |
engineDoPhase(java.security.Key publicKey,
boolean lastPhase)
Performs the shared secret calculation, which is the x coordinate of the point p = puplicKey * privateKey (*cofactor). |
protected byte[] |
engineGenerateSecret()
The result of this key agreement scheme, which is the x coordinate of the new ec point. |
protected int |
engineGenerateSecret(byte[] sharedSecret,
int offset)
After the last phase, this method copies the result in the provided buffer. |
protected javax.crypto.SecretKey |
engineGenerateSecret(java.lang.String algorithm)
Describe engineGenerateSecret method here. |
protected void |
engineInit(java.security.Key privateKey,
java.security.spec.AlgorithmParameterSpec param,
java.security.SecureRandom random)
Initializes this key agreement with a private key and an parameter set. |
protected void |
engineInit(java.security.Key privateKey,
java.security.SecureRandom secureRandom)
Initializes this with a given private key. |
protected boolean |
equalParameters(ECDSAParams p1,
ECDSAParams p2)
Compares 2 domain parameter sets. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ECDSAParams parameter_
protected ECDSAPrivateKey privateKey_
protected byte[] secret_
protected boolean withCoFactor_
Constructor Detail |
public ECDH()
this(flase)
.
Don't try to get an instance of this class but use the provider.
protected ECDH(boolean withCoFactorMultiplication)
ECDH
instance.
Don't try to get an instance of this class but use the provider.
withCoFactorMultiplication
- a boolean
value, if true cofactor multiplication is used.Method Detail |
protected java.security.Key engineDoPhase(java.security.Key publicKey, boolean lastPhase) throws java.lang.IllegalStateException, java.security.InvalidKeyException
publicKey
- a Key
value which is the peers public key and MUST use the
same domain parameter as the used private key.lastPhase
- a boolean
value indicates if this is the last phase in this scheme.
Key
value, which is null
if the lastPhase parameter is true.
java.lang.IllegalStateException
- if an error occurs
java.security.InvalidKeyException
- if an error occursprotected byte[] engineGenerateSecret() throws java.lang.IllegalStateException
byte[]
value which is the result of this key agreement.
java.lang.IllegalStateException
- never occurs.protected int engineGenerateSecret(byte[] sharedSecret, int offset) throws javax.crypto.ShortBufferException, java.lang.IllegalStateException
sharedSecret
- a byte[]
value to hold the secretoffset
- an int
value specifies the buffer offset
int
value, which is the length of the secret
javax.crypto.ShortBufferException
- if the provided buffer is too small
java.lang.IllegalStateException
- never thrown.protected javax.crypto.SecretKey engineGenerateSecret(java.lang.String algorithm) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.lang.IllegalStateException
engineGenerateSecret
method here.
algorithm
- a String
value value describing the secret key algorithm.
SecretKey
value of the specified type.
java.security.InvalidKeyException
- if an error occurs
java.security.NoSuchAlgorithmException
- if an error occurs
java.lang.IllegalStateException
- if an error occursprotected void engineInit(java.security.Key privateKey, java.security.spec.AlgorithmParameterSpec param, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyException
protected void engineInit(java.security.Key privateKey, java.security.SecureRandom secureRandom) throws java.security.InvalidKeyException
privateKey
- a Key
value, which must be a private ec keysecureRandom
- a SecureRandom
value
java.security.InvalidKeyException
- if the provided key is invalid.protected boolean equalParameters(ECDSAParams p1, ECDSAParams p2)
p1
- parameters to be comparedp2
- parameters to be compared
boolean
value if the parameters are equal.
|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |