КриптоПро .NET
Search Results for

    Показать/Скрыть содержание

    Struct CpHashAlgorithmName

    Specifies the name of a cryptographic hash algorithm.

    Implements
    IEquatable<CpHashAlgorithmName>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: CryptoPro.Security.Cryptography
    Assembly: CryptoPro.Security.Cryptography.dll
    Syntax
    public readonly struct CpHashAlgorithmName : IEquatable<CpHashAlgorithmName>
    Remarks

    Asymmetric Algorithms implemented using Microsoft's CNG (Cryptography Next Generation) API will interpret the underlying string value as a CNG algorithm identifier:

    • https://msdn.microsoft.com/en-us/library/windows/desktop/aa375534(v=vs.85).aspx

    As with CNG, the names are case-sensitive.

    Asymmetric Algorithms implemented using other technologies:

    • Must recognize at least "MD5", "SHA1", "SHA256", "SHA384", and "SHA512".
    • Should recognize additional CNG IDs for any other hash algorithms that they also support.

    Constructors

    CpHashAlgorithmName(string)

    Gets a CpHashAlgorithmName representing a custom name.

    Declaration
    public CpHashAlgorithmName(string name)
    Parameters
    Type Name Description
    string name

    The custom hash algorithm name.

    Properties

    GOST3411

    Gets a CpHashAlgorithmName representing "GOST R 34.11 - 1994.

    Declaration
    public static CpHashAlgorithmName GOST3411 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    GOST3411_2012_256

    Gets a CpHashAlgorithmName representing "GOST R 34.11 - 2012 (256).

    Declaration
    public static CpHashAlgorithmName GOST3411_2012_256 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    GOST3411_2012_512

    Gets a CpHashAlgorithmName representing "GOST R 34.11 - 2012 (512).

    Declaration
    public static CpHashAlgorithmName GOST3411_2012_512 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    MD5

    Gets a CpHashAlgorithmName representing "MD5"

    Declaration
    public static CpHashAlgorithmName MD5 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    Name

    Gets the underlying string representation of the algorithm name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string
    Remarks

    May be null or empty to indicate that no hash algorithm is applicable.

    SHA1

    Gets a CpHashAlgorithmName representing "SHA1"

    Declaration
    public static CpHashAlgorithmName SHA1 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    SHA256

    Gets a CpHashAlgorithmName representing "SHA256"

    Declaration
    public static CpHashAlgorithmName SHA256 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    SHA384

    Gets a CpHashAlgorithmName representing "SHA384"

    Declaration
    public static CpHashAlgorithmName SHA384 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    SHA3_256

    Gets a CpHashAlgorithmName representing "SHA3-256"

    Declaration
    public static CpHashAlgorithmName SHA3_256 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    SHA3_384

    Gets a CpHashAlgorithmName representing "SHA3-384"

    Declaration
    public static CpHashAlgorithmName SHA3_384 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    SHA3_512

    Gets a CpHashAlgorithmName representing "SHA3-512"

    Declaration
    public static CpHashAlgorithmName SHA3_512 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    SHA512

    Gets a CpHashAlgorithmName representing "SHA512"

    Declaration
    public static CpHashAlgorithmName SHA512 { get; }
    Property Value
    Type Description
    CpHashAlgorithmName

    Methods

    Equals(CpHashAlgorithmName)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(CpHashAlgorithmName other)
    Parameters
    Type Name Description
    CpHashAlgorithmName other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    Equals(object)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(HashAlgorithmName)

    Declaration
    public bool Equals(HashAlgorithmName other)
    Parameters
    Type Name Description
    HashAlgorithmName other
    Returns
    Type Description
    bool

    FromOid(string)

    Converts the specified OID to a hash algorithm name.

    Declaration
    public static CpHashAlgorithmName FromOid(string oidValue)
    Parameters
    Type Name Description
    string oidValue

    The OID of the hash algorithm.

    Returns
    Type Description
    CpHashAlgorithmName

    The hash algorithm name identified by the OID.

    Exceptions
    Type Condition
    ArgumentNullException

    oidValue is null.

    CryptographicException

    oidValue does not represent a known hash algorithm.

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Returns the fully qualified type name of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The fully qualified type name.

    Overrides
    ValueType.ToString()

    TryFromOid(string, out CpHashAlgorithmName)

    Tries to convert the specified OID to a hash algorithm name.

    Declaration
    public static bool TryFromOid(string oidValue, out CpHashAlgorithmName value)
    Parameters
    Type Name Description
    string oidValue

    The OID of the hash algorithm.

    CpHashAlgorithmName value

    When this method returns true, the hash algorithm. When this method returns false, contains default.

    Returns
    Type Description
    bool

    true if the OID was successfully mapped to a hash algorithm; otherwise false.

    Exceptions
    Type Condition
    ArgumentNullException

    oidValue is null.

    Operators

    operator ==(CpHashAlgorithmName, CpHashAlgorithmName)

    Declaration
    public static bool operator ==(CpHashAlgorithmName left, CpHashAlgorithmName right)
    Parameters
    Type Name Description
    CpHashAlgorithmName left
    CpHashAlgorithmName right
    Returns
    Type Description
    bool

    operator ==(CpHashAlgorithmName, HashAlgorithmName)

    Declaration
    public static bool operator ==(CpHashAlgorithmName left, HashAlgorithmName right)
    Parameters
    Type Name Description
    CpHashAlgorithmName left
    HashAlgorithmName right
    Returns
    Type Description
    bool

    operator ==(HashAlgorithmName, CpHashAlgorithmName)

    Declaration
    public static bool operator ==(HashAlgorithmName left, CpHashAlgorithmName right)
    Parameters
    Type Name Description
    HashAlgorithmName left
    CpHashAlgorithmName right
    Returns
    Type Description
    bool

    explicit operator CpHashAlgorithmName(HashAlgorithmName)

    Declaration
    public static explicit operator CpHashAlgorithmName(HashAlgorithmName han)
    Parameters
    Type Name Description
    HashAlgorithmName han
    Returns
    Type Description
    CpHashAlgorithmName

    implicit operator HashAlgorithmName(CpHashAlgorithmName)

    Declaration
    public static implicit operator HashAlgorithmName(CpHashAlgorithmName cphan)
    Parameters
    Type Name Description
    CpHashAlgorithmName cphan
    Returns
    Type Description
    HashAlgorithmName

    operator !=(CpHashAlgorithmName, CpHashAlgorithmName)

    Declaration
    public static bool operator !=(CpHashAlgorithmName left, CpHashAlgorithmName right)
    Parameters
    Type Name Description
    CpHashAlgorithmName left
    CpHashAlgorithmName right
    Returns
    Type Description
    bool

    operator !=(CpHashAlgorithmName, HashAlgorithmName)

    Declaration
    public static bool operator !=(CpHashAlgorithmName left, HashAlgorithmName right)
    Parameters
    Type Name Description
    CpHashAlgorithmName left
    HashAlgorithmName right
    Returns
    Type Description
    bool

    operator !=(HashAlgorithmName, CpHashAlgorithmName)

    Declaration
    public static bool operator !=(HashAlgorithmName left, CpHashAlgorithmName right)
    Parameters
    Type Name Description
    HashAlgorithmName left
    CpHashAlgorithmName right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    В этом разделе
    Наверх Generated by DocFX