|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bouncycastle.crypto.engines.EthereumIESEngine
Support class for constructing integrated encryption ciphers for doing basic message exchanges on top of key agreement ciphers. Follows the description given in IEEE Std 1363a.
Some tweaks added to IESEngine to conform to the Ethereum encryption approach.
Nested Class Summary | |
static class |
EthereumIESEngine.HandshakeKDFFunction
Basic KDF generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 This implementation is based on ISO 18033/P1363a. |
Constructor Summary | |
EthereumIESEngine(BasicAgreement agree,
DerivationFunction kdf,
Mac mac,
byte[] commonMac)
Set up for use with stream mode, where the key derivation function is used to provide a stream of bytes to xor with the message. |
|
EthereumIESEngine(BasicAgreement agree,
DerivationFunction kdf,
Mac mac,
byte[] commonMac,
BufferedBlockCipher cipher)
Set up for use in conjunction with a block cipher to handle the message. |
Method Summary | |
BufferedBlockCipher |
getCipher()
|
protected byte[] |
getLengthTag(byte[] p2)
|
Mac |
getMac()
|
void |
init(AsymmetricKeyParameter publicKey,
CipherParameters params,
EphemeralKeyPairGenerator ephemeralKeyPairGenerator)
Initialise the decryptor. |
void |
init(AsymmetricKeyParameter privateKey,
CipherParameters params,
KeyParser publicKeyParser)
Initialise the encryptor. |
void |
init(boolean forEncryption,
CipherParameters privParam,
CipherParameters pubParam,
CipherParameters params)
Initialise the encryptor. |
byte[] |
processBlock(byte[] in,
int inOff,
int inLen)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EthereumIESEngine(BasicAgreement agree, DerivationFunction kdf, Mac mac, byte[] commonMac)
agree
- the key agreement used as the basis for the encryptionkdf
- the key derivation function used for byte generationmac
- the message authentication code generator for the messagecommonMac
- the common MAC bytes to append to the macpublic EthereumIESEngine(BasicAgreement agree, DerivationFunction kdf, Mac mac, byte[] commonMac, BufferedBlockCipher cipher)
agree
- the key agreement used as the basis for the encryptionkdf
- the key derivation function used for byte generationmac
- the message authentication code generator for the messagecommonMac
- the common MAC bytes to append to the maccipher
- the cipher to used for encrypting the messageMethod Detail |
public void init(boolean forEncryption, CipherParameters privParam, CipherParameters pubParam, CipherParameters params)
forEncryption
- whether or not this is encryption/decryption.privParam
- our private key parameterspubParam
- the recipient's/sender's public key parametersparams
- encoding and derivation parameters, may be wrapped to include an IV for an underlying block cipher.public void init(AsymmetricKeyParameter publicKey, CipherParameters params, EphemeralKeyPairGenerator ephemeralKeyPairGenerator)
publicKey
- the recipient's/sender's public key parametersparams
- encoding and derivation parameters, may be wrapped to include an IV for an underlying block cipher.ephemeralKeyPairGenerator
- the ephemeral key pair generator to use.public void init(AsymmetricKeyParameter privateKey, CipherParameters params, KeyParser publicKeyParser)
privateKey
- the recipient's private key.params
- encoding and derivation parameters, may be wrapped to include an IV for an underlying block cipher.publicKeyParser
- the parser for reading the ephemeral public key.public BufferedBlockCipher getCipher()
public Mac getMac()
public byte[] processBlock(byte[] in, int inOff, int inLen) throws InvalidCipherTextException
InvalidCipherTextException
protected byte[] getLengthTag(byte[] p2)
|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |