Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

System.Security.Cryptography

System Library

Author Microsoft
Version 10.0.1
Tags

Public Types

Microsoft.​Win32.​SafeHandles

Provides a safe handle that can be used by Cryptography Next Generation (CNG) objects.
Provides a safe handle that represents a key (NCRYPT_KEY_HANDLE).
Provides a safe handle that represents a key storage provider (NCRYPT_PROV_HANDLE).
Provides a safe handle that represents a secret agreement value (NCRYPT_SECRET_HANDLE).
Provides a wrapper class that represents the handle of an X.509 chain object. For more information, see <see cref="T:System.Security.Cryptography.X509Certificates.X509Chain" /> .

System.​Security.​Cryptography

class Aes
Represents the abstract base class from which all implementations of the Advanced Encryption Standard (AES) must inherit.
class AesCcm
Represents an Advanced Encryption Standard (AES) key to be used with the Counter with CBC-MAC (CCM) mode of operation.
class AesCng
Provides a Cryptography Next Generation (CNG) implementation of the Advanced Encryption Standard (AES) algorithm.
Performs symmetric encryption and decryption using the Cryptographic Application Programming Interfaces (CAPI) implementation of the Advanced Encryption Standard (AES) algorithm.
class AesGcm
Represents an Advanced Encryption Standard (AES) key to be used with the Galois/Counter Mode (GCM) mode of operation.
Provides a managed implementation of the Advanced Encryption Standard (AES) symmetric algorithm.
Represents Abstract Syntax Notation One (ASN.1)-encoded data.
Represents a collection of <see cref="T:System.Security.Cryptography.AsnEncodedData" /> objects. This class cannot be inherited.
Provides the ability to navigate through an <see cref="T:System.Security.Cryptography.AsnEncodedDataCollection" /> object. This class cannot be inherited.
Represents the abstract base class from which all implementations of asymmetric algorithms must inherit.
Represents the base class from which all asymmetric key exchange deformatters derive.
Represents the base class from which all asymmetric key exchange formatters derive.
Represents the abstract base class from which all implementations of asymmetric signature deformatters derive.
Represents the base class from which all implementations of asymmetric signature formatters derive.
The exception that is thrown when a decryption operation with an authenticated cipher has an authentication tag mismatch.
Represents a symmetric key to be used with the ChaCha20 stream cipher in the combined mode with the Poly1305 authenticator.
Specifies the block cipher mode to use for encryption.
Encapsulates the name of an encryption algorithm.
Encapsulates the name of an encryption algorithm group.
Specifies the key export policies for a key.
class CngKey
Defines the core functionality for keys that are used with Cryptography Next Generation (CNG) objects.
Specifies a key BLOB format for use with Microsoft Cryptography Next Generation (CNG) objects.
Specifies options used for key creation.
Contains advanced properties for key creation.
Specifies options for opening key handles.
Specifies options for opening a key.
Specifies the cryptographic operations that a Cryptography Next Generation (CNG) key may be used with.
Encapsulates a property of a Cryptography Next Generation (CNG) key or provider.
Provides a strongly typed collection of Cryptography Next Generation (CNG) properties.
Specifies Cryptography Next Generation (CNG) key property options.
Encapsulates the name of a key storage provider (KSP) for use with Cryptography Next Generation (CNG) objects.
Encapsulates optional configuration parameters for the user interface (UI) that Cryptography Next Generation (CNG) displays when you access a protected key.
Specifies the protection level for the key in user interface (UI) prompting scenarios.
Represents a Composite ML-DSA key.
Represents a composite ML-DSA algorithm identifier, combining ML-DSA with a traditional algorithm.
Provides a Cryptography Next Generation (CNG) implementation of Composite ML-DSA.
Accesses the cryptography configuration information.
Provides methods for common cryptographic operations and reducing side-channel information leakage.
The exception that is thrown when an unexpected operation occurs during a cryptographic operation.
Defines a stream that links data streams to cryptographic transformations.
Specifies the mode of a cryptographic stream.
Provides additional information about a cryptographic key pair. This class cannot be inherited.
Contains parameters that are passed to the cryptographic service provider (CSP) that performs cryptographic computations. This class cannot be inherited.
Specifies flags that modify the behavior of the cryptographic service providers (CSP).
Represents the abstract base class from which all classes that derive byte sequences of a specified length inherit.
class DES
Represents the base class for the Data Encryption Standard (DES) algorithm from which all <see cref="T:System.Security.Cryptography.DES" /> implementations must derive.
Defines a wrapper object to access the cryptographic service provider (CSP) version of the Data Encryption Standard ( <see cref="T:System.Security.Cryptography.DES" /> ) algorithm. This class cannot be inherited.
class DSA
Represents the abstract base class from which all implementations of the Digital Signature Algorithm ( <see cref="T:System.Security.Cryptography.DSA" /> ) must inherit.
class DSACng
Provides a Cryptography Next Generation (CNG) implementation of the Digital Signature Algorithm (DSA).
Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.DSA" /> algorithm. This class cannot be inherited.
Provides an implementation of the Digital Signature Algorithm (DSA) backed by OpenSSL.
Contains the typical parameters for the <see cref="T:System.Security.Cryptography.DSA" /> algorithm.
Verifies a Digital Signature Algorithm ( <see cref="T:System.Security.Cryptography.DSA" /> ) PKCS#1 v1.5 signature.
Specifies the data format for signatures with the DSA family of algorithms.
Creates a Digital Signature Algorithm ( <see cref="T:System.Security.Cryptography.DSA" /> ) signature.
Represents the abstract class from which elliptic-curve asymmetric algorithms can inherit.
struct ECCurve
Represents an elliptic curve.
Provides an abstract base class that Elliptic Curve Diffie-Hellman (ECDH) algorithm implementations can derive from. This class provides the basic set of operations that all ECDH implementations must support.
Provides a Cryptography Next Generation (CNG) implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm. This class is used to perform cryptographic operations.
Specifies an Elliptic Curve Diffie-Hellman (ECDH) public key for use with the <see cref="T:System.Security.Cryptography.ECDiffieHellmanCng" /> class.
Specifies the key derivation function that the <see cref="T:System.Security.Cryptography.ECDiffieHellmanCng" /> class will use to convert secret agreements into key material.
Provides an implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm backed by OpenSSL.
Provides an abstract base class from which all <see cref="T:System.Security.Cryptography.ECDiffieHellmanCngPublicKey" /> implementations must inherit.
class ECDsa
Provides an abstract base class that encapsulates the Elliptic Curve Digital Signature Algorithm (ECDSA).
Provides a Cryptography Next Generation (CNG) implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA).
Provides an implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) backed by OpenSSL.
Defines XML serialization formats for elliptic curve keys.
Represents the standard parameters for the elliptic curve cryptography (ECC) algorithm.
struct ECPoint
Represents a (X,Y) coordinate pair for elliptic curve cryptography (ECC) structures.
Converts a <see cref="T:System.Security.Cryptography.CryptoStream" /> from base 64.
Specifies whether white space should be ignored in the base 64 transformation.
Represents the base class from which all implementations of cryptographic hash algorithms must derive.
Specifies the name of a cryptographic hash algorithm.
class HKDF
RFC5869 HMAC-based Extract-and-Expand Key Derivation (HKDF)
class HMAC
Represents the abstract class from which all implementations of Hash-based Message Authentication Code (HMAC) must derive.
class HMACMD5
Computes a Hash-based Message Authentication Code (HMAC) by using the <see cref="T:System.Security.Cryptography.MD5" /> hash function.
Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA1" /> hash function.
Computes a Hash-based Message Authentication Code (HMAC) by using the <see cref="T:System.Security.Cryptography.SHA256" /> hash function.
Computes a Hash-based Message Authentication Code (HMAC) by using the SHA-3-256 hash function.
Computes a Hash-based Message Authentication Code (HMAC) by using the SHA-3-384 hash function.
Computes a Hash-based Message Authentication Code (HMAC) by using the SHA-3-512 hash function.
Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA384" /> hash function.
Computes a Hash-based Message Authentication Code (HMAC) using the <see cref="T:System.Security.Cryptography.SHA512" /> hash function.
Defines the basic operations of cryptographic transformations.
Defines methods that allow an <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> class to enumerate key container information, and import and export Microsoft Cryptographic API (CAPI)-compatible key blobs.
Provides support for computing a hash or HMAC value incrementally across several segments.
Represents the abstract class from which all implementations of keyed hash algorithms must derive.
Specifies whether to create an asymmetric signature key or an asymmetric exchange key.
Determines the set of valid key sizes for the symmetric cryptographic algorithms.
class Kmac128
Computes the KMAC128 MAC for the input data.
class Kmac256
Computes the KMAC256 MAC for the input data.
Computes the KMACXOF128 MAC for the input data.
Computes the KMACXOF256 MAC for the input data.
Represents the abstract class from which all mask generator algorithms must derive.
class MD5
Represents the abstract class from which all implementations of the <see cref="T:System.Security.Cryptography.MD5" /> hash algorithm inherit.
Computes the <see cref="T:System.Security.Cryptography.MD5" /> hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited.
class MLDsa
Represents an ML-DSA key.
Represents a specific algorithm within the ML-DSA family.
Provides a Cryptography Next Generation (CNG) implementation of the Module-Lattice-Based Digital Signature Algorithm (ML-DSA).
Represents an ML-DSA key backed by OpenSSL.
class MLKem
Represents an ML-KEM key.
Represents a specific algorithm within the ML-KEM family.
<para>Provides a Cryptography Next Generation (CNG) implementation of the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM).</para>
Represents an ML-KEM key backed by OpenSSL.
class Oid
Represents a cryptographic object identifier. This class cannot be inherited.
Represents a collection of <see cref="T:System.Security.Cryptography.Oid" /> objects. This class cannot be inherited.
Provides the ability to navigate through an <see cref="T:System.Security.Cryptography.OidCollection" /> object. This class cannot be inherited.
Identifies Windows cryptographic object identifier (OID) groups.
Specifies the type of padding to apply when the message data block is shorter than the full number of bytes needed for a cryptographic operation.
Derives a key from a password using an extension of the PBKDF1 algorithm.
Specifies encryption algorithms to be used with Password-Based Encryption (PBE).
Represents parameters to be used for Password-Based Encryption (PBE).
Provides methods for reading and writing the IETF RFC 7468 subset of PEM (Privacy-Enhanced Mail) textual encodings. This class cannot be inherited.
Contains information about the location of PEM data.
Computes masks according to PKCS #1 for use by key exchange algorithms.
Provides functionality for generating random values.
class RC2
Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.RC2" /> algorithm must derive.
Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.RC2" /> algorithm. This class cannot be inherited.
Implements password-based key derivation functionality, PBKDF2, by using a pseudo-random number generator based on <see cref="T:System.Security.Cryptography.HMACSHA1" /> .
Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.Rijndael" /> symmetric encryption algorithm must inherit.
Accesses the managed version of the <see cref="T:System.Security.Cryptography.Rijndael" /> algorithm. This class cannot be inherited.
Implements a cryptographic Random Number Generator (RNG) using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited.
class RSA
Represents the base class from which all implementations of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm inherit.
class RSACng
Provides a Cryptography Next Generation (CNG) implementation of the RSA algorithm.
Performs asymmetric encryption and decryption using the implementation of the <see cref="T:System.Security.Cryptography.RSA" /> algorithm provided by the cryptographic service provider (CSP). This class cannot be inherited.
Specifies the padding mode and parameters to use with RSA encryption or decryption operations.
Specifies the padding mode to use with RSA encryption or decryption operations.
Decrypts Optimal Asymmetric Encryption Padding (OAEP) key exchange data.
Creates Optimal Asymmetric Encryption Padding (OAEP) key exchange data using <see cref="T:System.Security.Cryptography.RSA" /> .
Provides an implementation of the RSA algorithm backed by OpenSSL.
Represents the standard parameters for the <see cref="T:System.Security.Cryptography.RSA" /> algorithm.
Decrypts the PKCS #1 key exchange data.
Creates the PKCS#1 key exchange data using <see cref="T:System.Security.Cryptography.RSA" /> .
Verifies an <see cref="T:System.Security.Cryptography.RSA" /> PKCS #1 version 1.5 signature.
Creates an <see cref="T:System.Security.Cryptography.RSA" /> PKCS #1 version 1.5 signature.
Specifies the padding mode and parameters to use with RSA signature creation or verification operations.
Specifies the padding mode to use with RSA signature creation or verification operations.
Represents the <see langword="EVP_PKEY*" /> pointer type from OpenSSL.
class SHA1
Computes the <see cref="T:System.Security.Cryptography.SHA1" /> hash for the input data.
Computes the <see cref="T:System.Security.Cryptography.SHA1" /> hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited.
Computes the <see cref="T:System.Security.Cryptography.SHA1" /> hash for the input data using the managed library.
class SHA256
Computes the <see cref="T:System.Security.Cryptography.SHA256" /> hash for the input data.
Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.SHA256" /> algorithm.
Computes the <see cref="T:System.Security.Cryptography.SHA256" /> hash for the input data using the managed library.
Computes the SHA-3-256 hash for the input data.
Computes the SHA-3-384 hash for the input data.
Computes the SHA-3-512 hash for the input data.
class SHA384
Computes the <see cref="T:System.Security.Cryptography.SHA384" /> hash for the input data.
Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.SHA384" /> algorithm.
Computes the <see cref="T:System.Security.Cryptography.SHA384" /> hash for the input data using the managed library.
class SHA512
Computes the <see cref="T:System.Security.Cryptography.SHA512" /> hash for the input data.
Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the <see cref="T:System.Security.Cryptography.SHA512" /> algorithm.
Computes the <see cref="T:System.Security.Cryptography.SHA512" /> hash algorithm for the input data using the managed library.
Computes the SHAKE128 hash for the input data.
Computes the SHAKE256 hash for the input data.
Contains information about the properties of a digital signature.
class SlhDsa
Represents an SLH-DSA key.
Represents a specific algorithm within the SHL-DSA family.
<para>Provides a Cryptography Next Generation (CNG) implementation of the Stateless Hash-Based Digital Signature Algorithm (SLH-DSA).</para>
Represents an SLH-DSA key backed by OpenSSL.
NIST SP 800-108 HMAC CTR Key-Based Key Derivation (KBKDF)
Represents the abstract base class from which all implementations of symmetric algorithms must inherit.
Converts a <see cref="T:System.Security.Cryptography.CryptoStream" /> to base 64.
Represents the base class for Triple Data Encryption Standard algorithms from which all <see cref="T:System.Security.Cryptography.TripleDES" /> implementations must derive.
Provides a Cryptography Next Generation (CNG) implementation of the Triple Data Encryption Standard (3DES) algorithm.
Defines a wrapper object to access the cryptographic service provider (CSP) version of the <see cref="T:System.Security.Cryptography.TripleDES" /> algorithm. This class cannot be inherited.

System.​Security.​Cryptography.​X509Certificates

Represents an abstraction over the PKCS#10 CertificationRequestInfo and the X.509 TbsCertificate.
Specifies options when loading a <see cref="T:System.Security.Cryptography.X509Certificates.CertificateRequest" /> .
Facilitates building a Certificate Revocation List (CRL).
Provides extension methods for retrieving <see cref="T:System.Security.Cryptography.DSA" /> implementations for the public and private keys of an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> .
Provides extension methods for retrieving <see cref="T:System.Security.Cryptography.ECDsa" /> implementations for the public and private keys of a <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> certificate.
Specifies the way to open the X.509 certificate store.
Specifies the export Password Based Enryption (PBE) parameters with PKCS12 / PFX.
Represents a set of constraints to apply when loading PKCS#12/PFX contents.
The exception that is thrown when importing a PKCS#12/PFX has failed due to violating a specified limit.
Represents a certificate's public key information. This class cannot be inherited.
Provides extension methods for retrieving <see cref="T:System.Security.Cryptography.RSA" /> implementations for the public and private keys of an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> .
Specifies the location of the X.509 certificate store.
Specifies the name of the X.509 certificate store to open.
This class facilitates building a subject alternative name extension for an X.509 certificate.
Represents the distinguished name of an X509 certificate. This class cannot be inherited.
Facilitates building a distinguished name for an X.509 certificate.
Specifies characteristics of the X.500 distinguished name.
Represents a Relative Distinguished Name component of an X.500 Distinguished Name.
Represents the Authority Information Access X.509 Extension (1.3.6.1.5.5.7.1.1).
Represents the Authority Key Identifier X.509 Extension (2.5.29.35).
Defines the constraints set on a certificate. This class cannot be inherited.
Provides methods that help you use X.509 v.3 certificates.
Represents an X.509 certificate.
Represents a collection of <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> objects. This class cannot be inherited.
Supports a simple iteration over a <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2Collection" /> object. This class cannot be inherited.
Defines a collection that stores <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> objects.
Provides methods for loading an X.509 certificate or a PKCS#12 PFX that contains certificates.
Represents a chain-building engine for <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> certificates.
Represents an element of an X.509 chain.
Represents a collection of <see cref="T:System.Security.Cryptography.X509Certificates.X509ChainElement" /> objects. This class cannot be inherited.
Supports a simple iteration over an <see cref="T:System.Security.Cryptography.X509Certificates.X509ChainElementCollection" /> . This class cannot be inherited.
Represents the chain policy to be applied when building an X509 certificate chain. This class cannot be inherited.
Provides a simple structure for storing X509 chain status and error information.
Defines the status of an X509 chain.
The mode determining the root trust for building the certificate chain.
Specifies the format of an X.509 certificate.
Defines the collection of object identifiers (OIDs) that indicates the applications that use the key. This class cannot be inherited.
Represents an X509 extension.
Represents a collection of <see cref="T:System.Security.Cryptography.X509Certificates.X509Extension" /> objects. This class cannot be inherited.
Supports a simple iteration over a <see cref="T:System.Security.Cryptography.X509Certificates.X509ExtensionCollection" /> . This class cannot be inherited.
Specifies the type of value the <see cref="M:System.Security.Cryptography.X509Certificates.X509Certificate2Collection.Find(System.Security.Cryptography.X509Certificates.X509FindType,System.Object,System.Boolean)" /> method searches for.
Specifies how much of the X.509 certificate chain should be included in the X.509 data.
Defines where and how to import the private key of an X.509 certificate.
Defines the usage of a key contained within an X.509 certificate. This class cannot be inherited.
Defines how the certificate key can be used. If this value is not defined, the key can be used for any purpose.
Specifies the type of name the X509 certificate contains.
Specifies which X509 certificates in the chain should be checked for revocation.
Specifies the mode used to check for X509 certificate revocation.
Specifies the reason a certificate was revoked.
Base class for building encoded signatures as needed for X.509 certificates.
Represents an X.509 store, which is a physical store where certificates are persisted and managed. This class cannot be inherited.
Represents the Subject Alternative Name X.509 Extension (2.5.29.17).
Defines a string that identifies a certificate's subject key identifier (SKI). This class cannot be inherited.
Defines the type of hash algorithm to use with the <see cref="T:System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension" /> class.
Specifies conditions under which verification of certificates in the X509 chain should be conducted.