public class ArxanIESEngine
extends java.lang.Object
| 构造器和说明 |
|---|
ArxanIESEngine(org.spongycastle.crypto.BasicAgreement agree,
org.spongycastle.crypto.DerivationFunction kdf,
org.spongycastle.crypto.Mac mac,
org.spongycastle.crypto.Digest hash,
org.spongycastle.crypto.BufferedBlockCipher cipher)
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
org.spongycastle.crypto.BufferedBlockCipher |
getCipher() |
org.spongycastle.crypto.Mac |
getMac() |
void |
init(org.spongycastle.crypto.params.AsymmetricKeyParameter publicKey,
org.spongycastle.crypto.CipherParameters params,
org.spongycastle.crypto.generators.EphemeralKeyPairGenerator ephemeralKeyPairGenerator)
Initialise the encryptor.
|
void |
init(org.spongycastle.crypto.params.AsymmetricKeyParameter privateKey,
org.spongycastle.crypto.CipherParameters params,
org.spongycastle.crypto.KeyParser publicKeyParser)
Initialise the encryptor.
|
void |
init(boolean forEncryption,
org.spongycastle.crypto.CipherParameters privParam,
org.spongycastle.crypto.CipherParameters pubParam,
org.spongycastle.crypto.CipherParameters params)
Initialise the encryptor.
|
byte[] |
processBlock(byte[] in,
int inOff,
int inLen) |
byte[] |
processBlock(byte[] in,
int inOff,
int inLen,
byte[] macData) |
void |
setHashMacKey(boolean hashK2) |
public ArxanIESEngine(org.spongycastle.crypto.BasicAgreement agree,
org.spongycastle.crypto.DerivationFunction kdf,
org.spongycastle.crypto.Mac mac,
org.spongycastle.crypto.Digest hash,
org.spongycastle.crypto.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 messagehash - hash ing functioncipher - the actual cipherpublic void setHashMacKey(boolean hashK2)
public void init(boolean forEncryption,
org.spongycastle.crypto.CipherParameters privParam,
org.spongycastle.crypto.CipherParameters pubParam,
org.spongycastle.crypto.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(org.spongycastle.crypto.params.AsymmetricKeyParameter publicKey,
org.spongycastle.crypto.CipherParameters params,
org.spongycastle.crypto.generators.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(org.spongycastle.crypto.params.AsymmetricKeyParameter privateKey,
org.spongycastle.crypto.CipherParameters params,
org.spongycastle.crypto.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 org.spongycastle.crypto.BufferedBlockCipher getCipher()
public org.spongycastle.crypto.Mac getMac()
public byte[] processBlock(byte[] in,
int inOff,
int inLen)
throws org.spongycastle.crypto.InvalidCipherTextException
org.spongycastle.crypto.InvalidCipherTextExceptionpublic byte[] processBlock(byte[] in,
int inOff,
int inLen,
byte[] macData)
throws org.spongycastle.crypto.InvalidCipherTextException
org.spongycastle.crypto.InvalidCipherTextExceptionCopyright © 2018. All Rights Reserved.