C# Class Amazon.Util.CryptoUtilFactory.CryptoUtil

Inheritance: ICryptoUtil
Show file Open project: aws/aws-sdk-net

Private Properties

Property Type Description
CreateKeyedHashAlgorithm KeyedHashAlgorithm
ThreadSafeCreateKeyedHashedAlgorithm KeyedHashAlgorithm

Public Methods

Method Description
ComputeMD5Hash ( Stream steam ) : byte[]
ComputeMD5Hash ( byte data ) : byte[]
ComputeSHA256Hash ( Stream steam ) : byte[]
ComputeSHA256Hash ( byte data ) : byte[]
HMACSign ( byte data, string key, SigningAlgorithm algorithmName ) : string
HMACSign ( string data, string key, SigningAlgorithm algorithmName ) : string
HMACSignBinary ( byte data, byte key, SigningAlgorithm algorithmName ) : byte[]

Private Methods

Method Description
CreateKeyedHashAlgorithm ( SigningAlgorithm algorithmName ) : KeyedHashAlgorithm
ThreadSafeCreateKeyedHashedAlgorithm ( SigningAlgorithm algorithmName ) : KeyedHashAlgorithm

The iOS il2cpp implementation of System.Security.Cryptography.RandomNumberGenerator, which is called by the initialization of KeyedHashAlgorithm.Create for a given algorithm name, is not threadsafe. We keep track of which algorithms have been initialized, and retain a lock if this is the first time we create a particular algorithm.

Method Details

ComputeMD5Hash() public method

public ComputeMD5Hash ( Stream steam ) : byte[]
steam Stream
return byte[]

ComputeMD5Hash() public method

public ComputeMD5Hash ( byte data ) : byte[]
data byte
return byte[]

ComputeSHA256Hash() public method

public ComputeSHA256Hash ( Stream steam ) : byte[]
steam Stream
return byte[]

ComputeSHA256Hash() public method

public ComputeSHA256Hash ( byte data ) : byte[]
data byte
return byte[]

HMACSign() public method

public HMACSign ( byte data, string key, SigningAlgorithm algorithmName ) : string
data byte
key string
algorithmName SigningAlgorithm
return string

HMACSign() public method

public HMACSign ( string data, string key, SigningAlgorithm algorithmName ) : string
data string
key string
algorithmName SigningAlgorithm
return string

HMACSignBinary() public method

public HMACSignBinary ( byte data, byte key, SigningAlgorithm algorithmName ) : byte[]
data byte
key byte
algorithmName SigningAlgorithm
return byte[]