Interface IAsymCipher
- 
- All Known Implementing Classes:
- RsaCipher
 
 public interface IAsymCipherInterface for a public key cipher.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description org.bouncycastle.crypto.params.AsymmetricKeyParameterbyteArrayToKey(byte[] enckey)Converts a key from binary form.byte[]decryptAndVerify(byte[] ciphertext, boolean verifywithforeign)Decrypts a message and verifies the signature.byte[]keyToByteArray(org.bouncycastle.crypto.params.AsymmetricKeyParameter key)Converts a key to binary form.booleansetForeign(byte[] foreignpublic)Sets the public key of the communication partner.byte[]signAndEncrypt(byte[] msg, boolean encryptwithforeign)Signs a message and encrypts a message.
 
- 
- 
- 
Method Detail- 
setForeignboolean setForeign(byte[] foreignpublic) Sets the public key of the communication partner.- Parameters:
- foreignpublic- The public key.
- Returns:
- False, if the key was invalid.
 
 - 
signAndEncryptbyte[] signAndEncrypt(byte[] msg, boolean encryptwithforeign)Signs a message and encrypts a message.- Parameters:
- msg- The message.
- encryptwithforeign- True, if the foreign public key should be used for encryption, false, if the innate one should be used.
- Returns:
- The message with signature, encrypted.
 
 - 
decryptAndVerifybyte[] decryptAndVerify(byte[] ciphertext, boolean verifywithforeign)Decrypts a message and verifies the signature.- Parameters:
- msg- The signed and encrypted message.
- encryptwithforeign- True, if the foreign public key should be used for verification, false, if the innate one should be used.
- Returns:
- The message, null if verification failed.
 
 - 
keyToByteArraybyte[] keyToByteArray(org.bouncycastle.crypto.params.AsymmetricKeyParameter key) Converts a key to binary form.- Parameters:
- key- The key.
- Returns:
- The binary form of the key.
 
 - 
byteArrayToKeyorg.bouncycastle.crypto.params.AsymmetricKeyParameter byteArrayToKey(byte[] enckey) Converts a key from binary form.- Parameters:
- enckey- The encoded key.
- Returns:
- The key.
 
 
- 
 
-