CryptographicException 생성자

정의

CryptographicException 클래스의 새 인스턴스를 초기화합니다.

오버로드

CryptographicException()

기본 속성을 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

CryptographicException(Int32)

지정된 HRESULT 오류 코드를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

CryptographicException(String)

지정된 오류 메시지를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

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

serialize된 데이터를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

CryptographicException(String, Exception)

지정된 오류 메시지와 해당 예외의 원인인 내부 예외에 대한 참조를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

CryptographicException(String, String)

지정한 형식에서 지정된 오류 메시지를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

CryptographicException()

Source:
CryptographicException.cs
Source:
CryptographicException.cs
Source:
CryptographicException.cs

기본 속성을 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

public:
 CryptographicException();
public CryptographicException ();
Public Sub New ()

예제

다음 코드 예제는 매개 변수 없이 를 CryptographicException 생성하는 방법을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 CryptographicException 클래스입니다.

CryptographicException^ cryptographicException = gcnew CryptographicException;
CryptographicException cryptographicException =
    new CryptographicException();
Dim cryptographicException As New CryptographicException

설명

다음 표에는 CryptographicException의 인스턴스의 초기 속성 값이 나와 있습니다.

속성
InnerException null.
Message 지역화된 오류 메시지 문자열입니다.

적용 대상

CryptographicException(Int32)

Source:
CryptographicException.cs
Source:
CryptographicException.cs
Source:
CryptographicException.cs

지정된 HRESULT 오류 코드를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

public:
 CryptographicException(int hr);
public CryptographicException (int hr);
new System.Security.Cryptography.CryptographicException : int -> System.Security.Cryptography.CryptographicException
Public Sub New (hr As Integer)

매개 변수

hr
Int32

HRESULT 오류 코드입니다.

예제

다음 코드 예제에서는 에 대 한 오류 코드를 사용 하 여 를 CryptographicException 생성 하는 방법을 보여 줍니다 CryptographicUnexpectedOperationException. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 CryptographicException 클래스입니다.

int exceptionNumber = (int)0x80131431;
CryptographicException^ cryptographicException = gcnew CryptographicException( exceptionNumber );
int exceptionNumber = unchecked((int)0x80131431);
CryptographicException cryptographicException =
    new CryptographicException(exceptionNumber);
Dim exceptionNumber As Integer = &H80131431
Dim cryptographicException As _
    New CryptographicException(exceptionNumber)

설명

CryptographicException 생성자는 시스템 HRESULT 오류 코드를 수락하고 속성을 에 Message 해당하는 지역화된 메시지로 HRESULT설정합니다.

다음 표에는 CryptographicException의 인스턴스의 초기 속성 값이 나와 있습니다.

속성
InnerException null.
Message 지역화된 오류 메시지 문자열입니다.

적용 대상

CryptographicException(String)

Source:
CryptographicException.cs
Source:
CryptographicException.cs
Source:
CryptographicException.cs

지정된 오류 메시지를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

public:
 CryptographicException(System::String ^ message);
public CryptographicException (string? message);
public CryptographicException (string message);
new System.Security.Cryptography.CryptographicException : string -> System.Security.Cryptography.CryptographicException
Public Sub New (message As String)

매개 변수

message
String

예외에 대한 이유를 설명하는 오류 메시지입니다.

예제

다음 코드 예제에서는 사용자 지정 오류 메시지를 사용 하 여 를 CryptographicException 생성 하는 방법을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 CryptographicException 클래스입니다.

String^ errorMessage = (L"Unexpected Operation exception.");
CryptographicException^ cryptographicException = gcnew CryptographicException( errorMessage );
string errorMessage = ("Unexpected Operation exception.");
CryptographicException cryptographicException =
    new CryptographicException(errorMessage);
Dim errorMessage As String = "Unexpected Operation exception."
Dim cryptographicException As New CryptographicException(errorMessage)

설명

다음 표에는 CryptographicException의 인스턴스의 초기 속성 값이 나와 있습니다.

속성
InnerException null.
Message 오류 메시지 문자열입니다.

적용 대상

CryptographicException(SerializationInfo, StreamingContext)

Source:
CryptographicException.cs
Source:
CryptographicException.cs
Source:
CryptographicException.cs

주의

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

serialize된 데이터를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

protected:
 CryptographicException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected CryptographicException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[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 CryptographicException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Security.Cryptography.CryptographicException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.CryptographicException
[<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}")>]
new System.Security.Cryptography.CryptographicException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.CryptographicException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

매개 변수

info
SerializationInfo

serialize된 개체 데이터를 보유하는 개체입니다.

context
StreamingContext

원본 또는 대상에 대한 컨텍스트 정보입니다.

특성

설명

이 생성자는 스트림을 통해 전송되는 예외 개체를 다시 구성하기 위해 역직렬화 중에 호출됩니다.

적용 대상

CryptographicException(String, Exception)

Source:
CryptographicException.cs
Source:
CryptographicException.cs
Source:
CryptographicException.cs

지정된 오류 메시지와 해당 예외의 원인인 내부 예외에 대한 참조를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

public:
 CryptographicException(System::String ^ message, Exception ^ inner);
public CryptographicException (string? message, Exception? inner);
public CryptographicException (string message, Exception inner);
new System.Security.Cryptography.CryptographicException : string * Exception -> System.Security.Cryptography.CryptographicException
Public Sub New (message As String, inner As Exception)

매개 변수

message
String

예외에 대한 이유를 설명하는 오류 메시지입니다.

inner
Exception

현재 예외의 원인인 예외입니다. inner 매개 변수가 null이 아니면 현재 예외는 내부 예외를 처리하는 catch 블록에서 발생합니다.

예제

다음 코드 예제에서는 사용자 지정 오류 메시지 및 내부 예외를 사용 하 여 를 생성 CryptographicException 하는 방법을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 CryptographicException 클래스입니다.

String^ errorMessage = (L"The current operation is not supported.");
NullReferenceException^ nullException = gcnew NullReferenceException;
CryptographicException^ cryptographicException = gcnew CryptographicException( errorMessage,nullException );
string errorMessage = ("The current operation is not supported.");
NullReferenceException nullException = new NullReferenceException();
CryptographicException cryptographicException = 
    new CryptographicException(errorMessage, nullException);
Dim errorMessage As String = "The current operation is not supported."
Dim nullException As New NullReferenceException
Dim cryptographicException As _
    New CryptographicException(errorMessage, nullException)

설명

이전 예외의 직접적인 결과로 throw되는 예외의 InnerException 속성에는 이전 예외에 대한 참조가 들어 있어야 합니다. InnerException 속성은 생성자로 전달되는 값과 같은 값을 반환하거나, InnerException 속성이 생성자에 내부 예외 값을 제공하지 않는 경우 null을 반환합니다.

다음 표에는 CryptographicException의 인스턴스의 초기 속성 값이 나와 있습니다.

속성
InnerException 내부 예외 참조
Message 오류 메시지 문자열입니다.

추가 정보

적용 대상

CryptographicException(String, String)

Source:
CryptographicException.cs
Source:
CryptographicException.cs
Source:
CryptographicException.cs

지정한 형식에서 지정된 오류 메시지를 사용하여 CryptographicException 클래스의 새 인스턴스를 초기화합니다.

public:
 CryptographicException(System::String ^ format, System::String ^ insert);
public CryptographicException (string format, string? insert);
public CryptographicException (string format, string insert);
new System.Security.Cryptography.CryptographicException : string * string -> System.Security.Cryptography.CryptographicException
Public Sub New (format As String, insert As String)

매개 변수

format
String

오류 메시지를 출력하는데 사용하는 형식입니다.

insert
String

예외에 대한 이유를 설명하는 오류 메시지입니다.

예제

다음 코드 예제에서는 시간 형식 및 현재 날짜를 사용 하 여 를 CryptographicException 생성 하는 방법을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 CryptographicException 클래스입니다.

String^ dateFormat = L"{0:t}";
String^ timeStamp = (DateTime::Now.ToString());
CryptographicException^ cryptographicException = gcnew CryptographicException( dateFormat,timeStamp );
string dateFormat = "{0:t}";
string timeStamp = (DateTime.Now.ToString());
CryptographicException cryptographicException = 
    new CryptographicException(dateFormat, timeStamp);
Dim dateFormat As String = "{0:t}"
Dim timeStamp As String = DateTime.Now.ToString()
Dim cryptographicException As _
    New CryptographicException(dateFormat, timeStamp)

설명

다음 표에는 CryptographicException의 인스턴스의 초기 속성 값이 나와 있습니다.

속성
InnerException null.
Message 오류 메시지 문자열입니다.

적용 대상