CryptographicKey CryptographicKey CryptographicKey CryptographicKey Class

Represents a symmetric key or an asymmetric key pair.

Syntax

Declaration

public sealed class CryptographicKeypublic sealed class CryptographicKeyPublic NotInheritable Class CryptographicKey

Remarks

A CryptographicKey object is created when you use methods that create or import keys in the following classes:

Examples

[!code-csharpShowCryptographicKeyClass]

Properties summary

Gets the size, in bits, of the key.

Methods summary

Exports the key pair to a buffer.

Exports the key pair to a buffer given a specified format.

Exports a public key to a buffer.

Exports a public key to a buffer given a specified format.

Properties

  • KeySize
    KeySize
    KeySize
    KeySize

    Gets the size, in bits, of the key.

    public uint KeySize { get; }public uint KeySize { get; }Public ReadOnly Property KeySize As uint

    Property Value

    • uint
      uint
      uint
      uint

      Integer that contains the number of bits in the key.

Methods

  • Export()
    Export()
    Export()
    Export()

    Exports the key pair to a buffer.

    public IBuffer Export()public IBuffer Export()Public Function Export() As IBuffer

    Returns

  • Export(Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType)
    Export(Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType)
    Export(Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType)
    Export(Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType)

    Exports the key pair to a buffer given a specified format.

    public IBuffer Export(Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType BlobType)public IBuffer Export(Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType BlobType)Public Function Export(BlobType As Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType) As IBuffer

    Parameters

    Returns

  • ExportPublicKey()
    ExportPublicKey()
    ExportPublicKey()
    ExportPublicKey()

    Exports a public key to a buffer.

    public IBuffer ExportPublicKey()public IBuffer ExportPublicKey()Public Function ExportPublicKey() As IBuffer

    Returns

  • ExportPublicKey(Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType)
    ExportPublicKey(Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType)
    ExportPublicKey(Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType)
    ExportPublicKey(Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType)

    Exports a public key to a buffer given a specified format.

    public IBuffer ExportPublicKey(Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType BlobType)public IBuffer ExportPublicKey(Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType BlobType)Public Function ExportPublicKey(BlobType As Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType) As IBuffer

    Parameters

    Returns

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Security.Cryptography.Core.dll