StrongNameKeyPair Constructors

Definition

Initializes a new instance of the StrongNameKeyPair class.

Overloads

StrongNameKeyPair(Byte[])

Initializes a new instance of the StrongNameKeyPair class, building the key pair from a byte array.

StrongNameKeyPair(FileStream)

Initializes a new instance of the StrongNameKeyPair class, building the key pair from a FileStream.

StrongNameKeyPair(String)

Initializes a new instance of the StrongNameKeyPair class, building the key pair from a String.

StrongNameKeyPair(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the StrongNameKeyPair class, building the key pair from serialized data.

StrongNameKeyPair(Byte[])

Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs

Initializes a new instance of the StrongNameKeyPair class, building the key pair from a byte array.

C#
public StrongNameKeyPair(byte[] keyPairArray);

Parameters

keyPairArray
Byte[]

An array of type byte containing the key pair.

Exceptions

keyPairArray is null.

The caller does not have the required permission.

.NET 6+ only: In all cases.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

StrongNameKeyPair(FileStream)

Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs

Initializes a new instance of the StrongNameKeyPair class, building the key pair from a FileStream.

C#
public StrongNameKeyPair(System.IO.FileStream keyPairFile);

Parameters

keyPairFile
FileStream

A FileStream containing the key pair.

Exceptions

keyPairFile is null.

The caller does not have the required permission.

.NET 6+ only: In all cases.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

StrongNameKeyPair(String)

Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs

Initializes a new instance of the StrongNameKeyPair class, building the key pair from a String.

C#
public StrongNameKeyPair(string keyPairContainer);

Parameters

keyPairContainer
String

A string containing the key pair.

Exceptions

keyPairContainer is null.

The caller does not have the required permission.

.NET Core and .NET 5+ only: In all cases.

Remarks

The key pair is in a named key container.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

StrongNameKeyPair(SerializationInfo, StreamingContext)

Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs
Source:
StrongNameKeyPair.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the StrongNameKeyPair class, building the key pair from serialized data.

C#
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected StrongNameKeyPair(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
C#
protected StrongNameKeyPair(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

A SerializationInfo object that holds the serialized object data.

context
StreamingContext

A StreamingContext object that contains contextual information about the source or destination.

Attributes

Exceptions

.NET Core and .NET 5+ only: In all cases.

Remarks

This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see XML and SOAP Serialization.

See also

Applies to

.NET 10 and other versions
Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1