SymmetricEncryptionAlgorithm Class

public class SymmetricEncryptionAlgorithm extends EncryptionAlgorithm

Abstract base class for all symmetric encryption algorithms.

Constructor Summary

Constructor Description
SymmetricEncryptionAlgorithm(String name)

Constructor.

Method Summary

Modifier and Type Method and Description
abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag)

Creates a ICryptoTransform implementation for decryption using the supplied initialization vector and the specific provider for the Java Security API.

abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider)

Creates a ICryptoTransform implementation for decryption using the supplied initialization vector and the specific provider for the Java Security API.

abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData)

Creates a ICryptoTransform implementation for encryption using the supplied initialization vector and the specific provider for the Java Security API.

abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData, Provider provider)

Creates a ICryptoTransform implementation for encryption using the supplied initialization vector and the specific provider for the Java Security API.

Inherited Members

Constructor Details

SymmetricEncryptionAlgorithm

protected SymmetricEncryptionAlgorithm(String name)

Constructor.

Parameters:

name - The name of the algorithm.

Method Details

CreateDecryptor

public abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag)

Creates a ICryptoTransform implementation for decryption using the supplied initialization vector and the specific provider for the Java Security API.

Parameters:

key - The key material to be used.
iv - The initialization vector to be used.
authenticationData - The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms)
authenticationTag - The authentication tag to verify when using authenticating encryption algorithms (ignored for non-authenticating algorithms)

Returns:

A ICryptoTransform implementation

Throws:

InvalidKeyException
NoSuchAlgorithmException
NoSuchPaddingException
InvalidAlgorithmParameterException

CreateDecryptor

public abstract ICryptoTransform CreateDecryptor(byte[] key, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Provider provider)

Creates a ICryptoTransform implementation for decryption using the supplied initialization vector and the specific provider for the Java Security API.

Parameters:

key - The key material to be used.
iv - The initialization vector to be used.
authenticationData - The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms)
authenticationTag - The authentication tag to verify when using authenticating encryption algorithms (ignored for non-authenticating algorithms)
provider - The provider to use.

Returns:

A ICryptoTransform implementation

Throws:

InvalidKeyException
NoSuchAlgorithmException
NoSuchPaddingException
InvalidAlgorithmParameterException

CreateEncryptor

public abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData)

Creates a ICryptoTransform implementation for encryption using the supplied initialization vector and the specific provider for the Java Security API.

Parameters:

key - The key material to be used.
iv - The initialization vector to be used.
authenticationData - The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms)

Returns:

A ICryptoTransform implementation

Throws:

InvalidKeyException
NoSuchAlgorithmException
NoSuchPaddingException
InvalidAlgorithmParameterException

CreateEncryptor

public abstract ICryptoTransform CreateEncryptor(byte[] key, byte[] iv, byte[] authenticationData, Provider provider)

Creates a ICryptoTransform implementation for encryption using the supplied initialization vector and the specific provider for the Java Security API.

Parameters:

key - The key material to be used.
iv - The initialization vector to be used.
authenticationData - The authentication data to be used with authenticating encryption algorithms (ignored for non-authenticating algorithms)
provider - The provider to use.

Returns:

A ICryptoTransform implementation

Throws:

InvalidKeyException
NoSuchAlgorithmException
NoSuchPaddingException
InvalidAlgorithmParameterException

Applies to