AsymmetricAlgorithm.Create 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
비대칭 알고리즘을 수행하는 데 사용되는 암호화 개체를 만듭니다.
오버로드
| Name | Description |
|---|---|
| Create() |
비대칭 알고리즘을 수행하는 데 사용되는 기본 암호화 개체를 만듭니다. |
| Create(String) |
지정된 비대칭 알고리즘 구현의 인스턴스를 만듭니다. |
Create()
비대칭 알고리즘을 수행하는 데 사용되는 기본 암호화 개체를 만듭니다.
public:
static System::Security::Cryptography::AsymmetricAlgorithm ^ Create();
public static System.Security.Cryptography.AsymmetricAlgorithm Create();
static member Create : unit -> System.Security.Cryptography.AsymmetricAlgorithm
Public Shared Function Create () As AsymmetricAlgorithm
반품
cryptoClass> 요소로< 기본 설정이 변경되지 않는 한 새 RSACryptoServiceProvider 인스턴스입니다.
예외
.NET Core 2.0 - 3.1 및 .NET 5 이상: 모든 경우에.
설명
이 메서드는 .NET 5 이상 버전에서 사용되지 않습니다.
Example
다음 코드 예제에서는 확장 클래스에서 메서드를 Create 구현 하는 방법을 보여 줍니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 AsymmetricAlgorithm 일부입니다.
// The create function attempts to create a CustomCrypto object using
// the assembly name. This functionality requires modification of the
// machine.config file. Add the following section to the configuration
// element and modify the values of the cryptoClass to reflect what is
// installed in your machines GAC.
// <cryptoClass CustomCrypto="Contoso.CustomCrypto,
// CustomCrypto,
// Culture=neutral,
// PublicKeyToken=fdb9f9c4851028bf,
// Version=1.0.1448.27640" />
// <nameEntry name="Contoso.CustomCrypto" class="CustomCrypto" />
// <nameEntry name="CustomCrypto" class="CustomCrypto" />
new static public CustomCrypto Create()
{
return Create("CustomCrypto");
}
' The create function attempts to create a vbCustomCrypto object using
' the assembly name. This functionality requires modification of the
' machine.config file. Add the following section to the configuration
' element and modify the values of the cryptoClass to reflect what is
' installed in your machines GAC.
' <cryptoClass vbCustomCrypto="Contoso.vbCustomCrypto,
' vbCustomCrypto,
' Culture=neutral,
' PublicKeyToken=fdb9f9c4851028bf,
' Version=1.0.1448.27640" />
' <nameEntry name="Contoso.vbCustomCrypto"
' class="vbCustomCrypto" />
' <nameEntry name="vbCustomCrypto" class="vbCustomCrypto" />
Public Shadows Function Create() As vbCustomCrypto
Return Create("vbCustomCrypto")
End Function
추가 정보
적용 대상
Create(String)
지정된 비대칭 알고리즘 구현의 인스턴스를 만듭니다.
public:
static System::Security::Cryptography::AsymmetricAlgorithm ^ Create(System::String ^ algName);
public static System.Security.Cryptography.AsymmetricAlgorithm Create(string algName);
static member Create : string -> System.Security.Cryptography.AsymmetricAlgorithm
Public Shared Function Create (algName As String) As AsymmetricAlgorithm
매개 변수
- algName
- String
사용할 비대칭 알고리즘 구현입니다. 다음 표에서는 매개 변수에 대한 algName 유효한 값과 매핑되는 알고리즘을 보여 줍니다.
| 매개 변수 값 | 구현 |
|---|---|
| System.Security.Cryptography.AsymmetricAlgorithm | AsymmetricAlgorithm |
| Rsa | RSA |
| System.Security.Cryptography.RSA | RSA |
| Dsa | DSA |
| System.Security.Cryptography.DSA | DSA |
| Ecdsa | ECDsa |
| ECDsaCng | ECDsaCng |
| System.Security.Cryptography.ECDsaCng | ECDsaCng |
| Ecdh | ECDiffieHellman |
| ECDiffieHellman | ECDiffieHellman |
| ECDiffieHellmanCng | ECDiffieHellmanCng |
| System.Security.Cryptography.ECDiffieHellmanCng | ECDiffieHellmanCng |
반품
지정된 비대칭 알고리즘 구현의 새 인스턴스입니다.
예제
다음 코드 예제에서는 확장 클래스에서 메서드를 Create 구현 하는 방법을 보여 줍니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 AsymmetricAlgorithm 일부입니다.
// The create function attempts to create a CustomCrypto object using
// the assembly name. This functionality requires modification of the
// machine.config file. Add the following section to the configuration
// element and modify the values of the cryptoClass to reflect what is
// installed in your machines GAC.
// <cryptoClass CustomCrypto="Contoso.CustomCrypto,
// CustomCrypto,
// Culture=neutral,
// PublicKeyToken=fdb9f9c4851028bf,
// Version=1.0.1448.27640" />
// <nameEntry name="Contoso.CustomCrypto" class="CustomCrypto" />
// <nameEntry name="CustomCrypto" class="CustomCrypto" />
new static public CustomCrypto Create(String algorithmName)
{
return (CustomCrypto) CryptoConfig.CreateFromName(algorithmName);
}
' The create function attempts to create a vbCustomCrypto object using
' the assembly name. This functionality requires modification of the
' machine.config file. Add the following section to the configuration
' element and modify the values of the cryptoClass to reflect what is
' installed in your machines GAC.
' <cryptoClass vbCustomCrypto="Contoso.vbCustomCrypto,
' vbCustomCrypto,
' Culture=neutral,
' PublicKeyToken=fdb9f9c4851028bf,
' Version=1.0.1448.27640" />
' <nameEntry name="Contoso.vbCustomCrypto"
' class="vbCustomCrypto" />
' <nameEntry name="vbCustomCrypto" class="vbCustomCrypto" />
Public Shadows Function Create( _
ByVal algorithmName As String) As vbCustomCrypto
Return CType( _
CryptoConfig.CreateFromName(algorithmName), _
vbCustomCrypto)
End Function