|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.crypto.KeyAgreementSpi
|
+--de.flexiprovider.api.KeyAgreement
| Constructor Summary | |
KeyAgreement()
|
|
| Method Summary | |
abstract Key |
doPhase(PublicKey pubKey,
boolean lastPhase)
Execute the next phase of this key agreement with the given public key that was received from one of the other parties involved in this key agreement. |
protected java.security.Key |
engineDoPhase(java.security.Key key,
boolean lastPhase)
JCA adapter for FlexiAPI method doPhase(PublicKey, boolean):
execute the next phase of this key agreement with the given key that was
received from one of the other parties involved in this key agreement. |
protected byte[] |
engineGenerateSecret()
JCA adapter for FlexiAPI method generateSecret() : generate a
shared secret and return it as a byte array. |
protected int |
engineGenerateSecret(byte[] sharedSecret,
int offset)
JCA adapter for FlexiAPI method generateSecret(byte[], int):
generate a shared secret and place it into the buffer
sharedSecret, beginning at offset. |
protected javax.crypto.SecretKey |
engineGenerateSecret(java.lang.String algorithm)
JCA adapter for FlexiAPI method generateSecret(String):
generate a shared secret via the algorithm specified in
algorithm. |
protected void |
engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom javaRand)
JCA adapter for FlexiAPI method init(): initialize this KeyAgreementSpi with a key, algorithm parameters, and a source of randomness. |
protected void |
engineInit(java.security.Key key,
java.security.SecureRandom javaRand)
JCA adapter for FlexiAPI method init(): initialize this KeyAgreementSpi with a key and a source of randomness. |
abstract byte[] |
generateSecret()
Generate a shared secret and return it as a byte array. |
abstract int |
generateSecret(byte[] sharedSecret,
int offset)
Generate a shared secret and place it into the buffer sharedSecret, beginning at offset. |
abstract SecretKey |
generateSecret(java.lang.String algorithm)
Generate a shared secret via the algorithm specified in algorithm. |
abstract void |
init(PrivateKey privKey,
AlgorithmParameterSpec params,
SecureRandom random)
Initialize this key agreement with a private key, algorithm parameters, and a source of randomness. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public KeyAgreement()
| Method Detail |
protected final void engineInit(java.security.Key key,
java.security.SecureRandom javaRand)
throws java.security.InvalidKeyException
engineInit in class javax.crypto.KeyAgreementSpikey - the secret key of the party initializing the key agreementjavaRand - the source of randomnessjava.security.InvalidKeyException - if the key is invalid.java.lang.RuntimeException - if parameters are required for initialization.
protected final void engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom javaRand)
throws java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException
engineInit in class javax.crypto.KeyAgreementSpikey - the secret key of the party initializing the key agreementparams - the algorithm parametersjavaRand - the source of randomnessjava.security.InvalidKeyException - if the key is invalid.java.security.InvalidAlgorithmParameterException - if the parameters are invalid or null and parameters are
needed for initialization.
protected final byte[] engineGenerateSecret()
throws java.lang.IllegalStateException
generateSecret() : generate a
shared secret and return it as a byte array.engineGenerateSecret in class javax.crypto.KeyAgreementSpijava.lang.IllegalStateException - if the object is not in doPhase.
protected final int engineGenerateSecret(byte[] sharedSecret,
int offset)
throws java.lang.IllegalStateException,
javax.crypto.ShortBufferException
generateSecret(byte[], int):
generate a shared secret and place it into the buffer
sharedSecret, beginning at offset.engineGenerateSecret in class javax.crypto.KeyAgreementSpisharedSecret - the buffer to hold the shared secretoffset - the offset in sharedSecret where the shared
secret will be storedjava.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.javax.crypto.ShortBufferException - if sharedSecret is too small to to hold the
shared secret
protected final javax.crypto.SecretKey engineGenerateSecret(java.lang.String algorithm)
throws java.lang.IllegalStateException,
java.security.NoSuchAlgorithmException
generateSecret(String):
generate a shared secret via the algorithm specified in
algorithm.engineGenerateSecret in class javax.crypto.KeyAgreementSpialgorithm - the desired algorithm for the generation of the secretjava.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.java.security.NoSuchAlgorithmException - if algorithm is invalid.
protected final java.security.Key engineDoPhase(java.security.Key key,
boolean lastPhase)
throws java.security.InvalidKeyException,
java.lang.IllegalStateException
doPhase(PublicKey, boolean):
execute the next phase of this key agreement with the given key that was
received from one of the other parties involved in this key agreement.engineDoPhase in class javax.crypto.KeyAgreementSpikey - the public key of the other partylastPhase - true if this is the last phase of the key
agreement. After the last phase only
generateSecret may be called.java.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.java.security.InvalidKeyException - if the key is invalid.
public abstract void init(PrivateKey privKey,
AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidKeyException,
InvalidAlgorithmParameterException
privKey - the private key of the party initializing the key
agreementparams - the algorithm parametersrandom - the source of randomnessInvalidKeyException - if the key is invalid.InvalidAlgorithmParameterException - if the parameters are invalid.
public abstract byte[] generateSecret()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.
public abstract int generateSecret(byte[] sharedSecret,
int offset)
throws java.lang.IllegalStateException,
ShortBufferException
sharedSecret - the buffer to hold the shared secretoffset - the offset in sharedSecret where the shared
secret will be storedjava.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.ShortBufferException - if sharedSecret is too small to to hold the
shared secret
public abstract SecretKey generateSecret(java.lang.String algorithm)
throws java.lang.IllegalStateException,
NoSuchAlgorithmException
algorithm - the desired algorithm for the generation of the secretjava.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.NoSuchAlgorithmException - if algorithm is invalid.
public abstract Key doPhase(PublicKey pubKey,
boolean lastPhase)
throws InvalidKeyException,
java.lang.IllegalStateException
pubKey - the public key of the other partylastPhase - true if this is the last phase of the key
agreement. After the last phase only
generateSecret may be called.java.lang.IllegalStateException - if the key agreement scheme has not been initialized
properly.InvalidKeyException - if the key is invalid.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||