StrongNameKeyPair 클래스

정의

주의

Strong name signing is not supported and throws PlatformNotSupportedException.

강력한 이름 어셈블리를 서명하는 데 사용되는 퍼블릭 또는 프라이빗 키 쌍에 대한 액세스를 캡슐화합니다.

public ref class StrongNameKeyPair : System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
public ref class StrongNameKeyPair
public class StrongNameKeyPair : System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
[System.Obsolete("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0017", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public class StrongNameKeyPair : System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
[System.Serializable]
public class StrongNameKeyPair
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class StrongNameKeyPair : System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
type StrongNameKeyPair = class
    interface IDeserializationCallback
    interface ISerializable
[<System.Obsolete("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0017", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type StrongNameKeyPair = class
    interface IDeserializationCallback
    interface ISerializable
[<System.Serializable>]
type StrongNameKeyPair = class
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type StrongNameKeyPair = class
    interface IDeserializationCallback
    interface ISerializable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type StrongNameKeyPair = class
    interface ISerializable
    interface IDeserializationCallback
Public Class StrongNameKeyPair
Implements IDeserializationCallback, ISerializable
Public Class StrongNameKeyPair
상속
StrongNameKeyPair
특성
구현

예제

다음 코드 예제에서는 -k 스위치를 사용하여 Sn.exe(강력한 이름 도구)를 실행하여 생성된 Company.keys 파일을 열고, 파일에서 공개 키를 읽고, 콘솔 창에 키를 표시하는 방법을 보여 줍니다.

using namespace System;
using namespace System::IO;
using namespace System::Reflection;

ref class snkX
{
public:
    static void Main()
    {
        // Open a file that contains a public key value. The line below  
        // assumes that the Strong Name tool (SN.exe) was executed from 
        // a command prompt as follows:
        //       SN.exe -k C:\Company.keys
        FileStream^ fs = File::Open("C:\\Company.keys", FileMode::Open);

        // Construct a StrongNameKeyPair object. This object should obtain
        // the public key from the Company.keys file.
        StrongNameKeyPair^ k = gcnew StrongNameKeyPair(fs);

        // Display the bytes that make up the public key.
        Console::WriteLine(BitConverter::ToString(k->PublicKey));

        // Close the file.
        fs->Close();
    }
};

int main()
{
    snkX::Main();
}

// Output will vary by user.
// 
//  00-24-00-00-04-80-00-00-94-69-89-78-BB-F1-F2-71-00-00-00-34-26-
//  69-89-78-BB-F1-F2-71-00-F1-FA-F2-F9-4A-A8-5E-82-55-AB-49-4D-A6-
//  ED-AB-5F-CE-DE-59-49-8D-63-01-B0-E1-BF-43-07-FA-55-D4-36-75-EE-
//  8B-83-32-39-B7-02-DE-3D-81-29-7B-E8-EA-F0-2E-78-94-96-F1-73-79-
//  69-89-78-BB-F1-F2-71-0E-4E-F4-5D-DD-A4-7F-11-54-DF-65-DE-89-23-
//  91-AD-53-E1-C0-DA-9E-0C-88-BE-AA-7B-39-20-9C-9B-55-34-26-3B-1A-
//  53-41-31-00-04-00-00-01-00-01-00-9D-F1-EA-14-4C-88-34-26-3B-1A-
//  2D-D7-A0-AB-F6-7E-B7-24-7F-87-DF-3E-97
using System;
using System.IO;
using System.Reflection;

class snkX
{

    public static void Main()
    {
        // Open a file that contains a public key value. The line below
        // assumes that the Strong Name tool (SN.exe) was executed from
        // a command prompt as follows:
        //       SN.exe -k C:\Company.keys
        FileStream fs = File.Open("C:\\Company.keys", FileMode.Open);

        // Construct a StrongNameKeyPair object. This object should obtain
        // the public key from the Company.keys file.
        StrongNameKeyPair k = new StrongNameKeyPair(fs);

        // Display the bytes that make up the public key.
        Console.WriteLine(BitConverter.ToString(k.PublicKey));

        // Close the file.
        fs.Close();
    }
}

// Output will vary by user.
//
//  00-24-00-00-04-80-00-00-94-69-89-78-BB-F1-F2-71-00-00-00-34-26-
//  69-89-78-BB-F1-F2-71-00-F1-FA-F2-F9-4A-A8-5E-82-55-AB-49-4D-A6-
//  ED-AB-5F-CE-DE-59-49-8D-63-01-B0-E1-BF-43-07-FA-55-D4-36-75-EE-
//  8B-83-32-39-B7-02-DE-3D-81-29-7B-E8-EA-F0-2E-78-94-96-F1-73-79-
//  69-89-78-BB-F1-F2-71-0E-4E-F4-5D-DD-A4-7F-11-54-DF-65-DE-89-23-
//  91-AD-53-E1-C0-DA-9E-0C-88-BE-AA-7B-39-20-9C-9B-55-34-26-3B-1A-
//  53-41-31-00-04-00-00-01-00-01-00-9D-F1-EA-14-4C-88-34-26-3B-1A-
//  2D-D7-A0-AB-F6-7E-B7-24-7F-87-DF-3E-97
Imports System.Reflection
Imports System.IO

Module Module1

    Sub Main()
        ' Open a file that contains a public key value. The line below  
        ' assumes that the Strong Name tool (SN.exe) was executed from 
        ' a command prompt as follows:
        '       SN.exe -k C:\Company.keys
        Dim fs As FileStream = File.Open("C:\Company.keys", FileMode.Open)

        ' Construct a StrongNameKeyPair object. This object should obtain 
        ' the public key from the Company.keys file.
        Dim k As Reflection.StrongNameKeyPair = _
            New Reflection.StrongNameKeyPair(fs)

        ' Display the bytes that make up the public key.
        Console.WriteLine(BitConverter.ToString(k.PublicKey))

        ' Close the file.
        fs.Close()
    End Sub
End Module

' Output will vary by user.
' 
'  00-24-00-00-04-80-00-00-94-69-89-78-BB-F1-F2-71-00-00-00-34-26-
'  69-89-78-BB-F1-F2-71-00-F1-FA-F2-F9-4A-A8-5E-82-55-AB-49-4D-A6-
'  ED-AB-5F-CE-DE-59-49-8D-63-01-B0-E1-BF-43-07-FA-55-D4-36-75-EE-
'  8B-83-32-39-B7-02-DE-3D-81-29-7B-E8-EA-F0-2E-78-94-96-F1-73-79-
'  69-89-78-BB-F1-F2-71-0E-4E-F4-5D-DD-A4-7F-11-54-DF-65-DE-89-23-
'  91-AD-53-E1-C0-DA-9E-0C-88-BE-AA-7B-39-20-9C-9B-55-34-26-3B-1A-
'  53-41-31-00-04-00-00-01-00-01-00-9D-F1-EA-14-4C-88-34-26-3B-1A-
'  2D-D7-A0-AB-F6-7E-B7-24-7F-87-DF-3E-97

생성자

StrongNameKeyPair(Byte[])
사용되지 않음.

byte 배열에서 키 쌍을 작성하여 StrongNameKeyPair 클래스의 새 인스턴스를 초기화합니다.

StrongNameKeyPair(FileStream)
사용되지 않음.

FileStream에서 키 쌍을 작성하여 StrongNameKeyPair 클래스의 새 인스턴스를 초기화합니다.

StrongNameKeyPair(SerializationInfo, StreamingContext)
사용되지 않음.

serialize된 데이터에서 키 쌍을 작성하여 StrongNameKeyPair 클래스의 새 인스턴스를 초기화합니다.

StrongNameKeyPair(String)
사용되지 않음.

String에서 키 쌍을 작성하여 StrongNameKeyPair 클래스의 새 인스턴스를 초기화합니다.

속성

PublicKey
사용되지 않음.

공용 키의 공용 부분 또는 키 쌍의 공용 키 토큰을 가져옵니다.

메서드

Equals(Object)
사용되지 않음.

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()
사용되지 않음.

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()
사용되지 않음.

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()
사용되지 않음.

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()
사용되지 않음.

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IDeserializationCallback.OnDeserialization(Object)
사용되지 않음.

전체 개체 그래프가 역직렬화될 때 실행됩니다.

ISerializable.GetObjectData(SerializationInfo, StreamingContext)
사용되지 않음.

현재 SerializationInfo 개체를 다시 인스턴스화하는 데 필요한 모든 데이터로 StrongNameKeyPair 개체를 설정합니다.

적용 대상

추가 정보