Share via


SignedCms.CheckSignature 메서드

정의

서명된 CMS/PKCS #7 메시지에서 디지털 서명의 안정성을 확인합니다.

오버로드

CheckSignature(Boolean)

CheckSignature(Boolean) 메서드는 서명된 CMS/PKCS #7 메시지에서 디지털 서명의 안정성을 확인하며 필요에 따라 서명자 인증서의 유효성을 검사합니다.

CheckSignature(X509Certificate2Collection, Boolean)

CheckSignature(X509Certificate2Collection, Boolean) 메서드는 지정된 인증서 컬렉션을 사용하여 서명된 CMS/PKCS #7 메시지에서 디지털 서명의 안정성을 확인하고 필요에 따라 서명자 인증서의 유효성을 검사합니다.

CheckSignature(Boolean)

Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs

CheckSignature(Boolean) 메서드는 서명된 CMS/PKCS #7 메시지에서 디지털 서명의 안정성을 확인하며 필요에 따라 서명자 인증서의 유효성을 검사합니다.

public:
 void CheckSignature(bool verifySignatureOnly);
public void CheckSignature (bool verifySignatureOnly);
member this.CheckSignature : bool -> unit
Public Sub CheckSignature (verifySignatureOnly As Boolean)

매개 변수

verifySignatureOnly
Boolean

서명자 인증서의 유효성은 검사하지 않고 디지털 서명의 안정성만 확인할 것인지 여부를 지정하는 Boolean 값입니다.

verifySignatureOnlytrue이면 디지털 서명의 안정성만 확인합니다. false이면 디지털 서명의 안정성을 확인하고 서명자 인증서의 유효성을 검사한 다음 인증서 용도의 유효성을 검사합니다. 인증서에 키 용도가 없거나 키 용도가 디지털 서명 또는 거부 불가능을 지원하는 경우 인증서 용도가 유효한 것으로 간주됩니다.

예외

null 참조를 유효한 인수로 사용하지 않는 메서드에 null 참조가 전달된 경우

암호화 작업을 완료할 수 없는 경우

개체의 현재 상태에서 메서드 호출을 사용할 수 없는 경우

예제

다음 예제에서는 메시지의 서명을 확인하는 데 필요한 단계 중의 CheckSignature(Boolean) 배치를 SignedCms 보여 줍니다. 이 예제에서는 메시지 콘텐츠가 분리되지 않습니다. 메시지 콘텐츠는 메시지에 포함됩니다 SignedCms .

// Create a new, nondetached SignedCms message.
SignedCms signedCms = new SignedCms();

// encodedMessage is the encoded message received from
// the sender.
signedCms.Decode(encodedMessage);

// Verify the signature without validating the
// certificate.
signedCms.CheckSignature(true);
' Create a new, nondetached SignedCms message.
Dim signedCms As New SignedCms()

' encodedMessage is the encoded message received from 
' the sender.
signedCms.Decode(encodedMessage)

' Verify the signature without validating the 
' certificate.
signedCms.CheckSignature(True)

다음 예제에서는 메시지의 서명을 확인하는 데 필요한 단계 중의 CheckSignature(Boolean) 배치를 SignedCms 보여 줍니다. 이 예제에서는 메시지 콘텐츠가 분리되므로 메시지 콘텐츠는 메시지와 독립적으로 SignedCms 확인해야 합니다.

// Create a ContentInfo object from the inner content obtained
// independently from encodedMessage.
ContentInfo contentInfo = new ContentInfo(innerContent);

// Create a new, detached SignedCms message.
SignedCms signedCms = new SignedCms(contentInfo, true);

// encodedMessage is the encoded message received from
// the sender.
signedCms.Decode(encodedMessage);

// Verify the signature without validating the
// certificate.
signedCms.CheckSignature(true);
' Create a ContentInfo object from the inner content obtained 
' independently from encodedMessage.
Dim contentInfo As New ContentInfo(innerContent)

' Create a new, detached SignedCms message.
Dim signedCms As New SignedCms(contentInfo, True)

' encodedMessage is the encoded message received from 
' the sender.
signedCms.Decode(encodedMessage)

' Verify the signature without validating the 
' certificate.
signedCms.CheckSignature(True)

설명

이 메서드는 CMS/PKCS #7 메시지에서 서명과 같은 모든 서명을 확인합니다. 메시지에 포함된 서명된 특성이 있는 경우 이러한 특성도 확인됩니다. 인증서의 유효성을 검사하는 옵션을 선택하면 인증서 체인의 포함된 전체 부분의 유효성이 검사됩니다.

이 메서드는 디지털 서명 확인에 실패하거나 유효성 검사 요구 사항이 충족되지 않는 경우 예외를 throw합니다.

적용 대상

CheckSignature(X509Certificate2Collection, Boolean)

Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs
Source:
SignedCms.cs

CheckSignature(X509Certificate2Collection, Boolean) 메서드는 지정된 인증서 컬렉션을 사용하여 서명된 CMS/PKCS #7 메시지에서 디지털 서명의 안정성을 확인하고 필요에 따라 서명자 인증서의 유효성을 검사합니다.

public:
 void CheckSignature(System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ extraStore, bool verifySignatureOnly);
public void CheckSignature (System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraStore, bool verifySignatureOnly);
member this.CheckSignature : System.Security.Cryptography.X509Certificates.X509Certificate2Collection * bool -> unit
Public Sub CheckSignature (extraStore As X509Certificate2Collection, verifySignatureOnly As Boolean)

매개 변수

extraStore
X509Certificate2Collection

인증서 체인의 유효성을 검사하는 데 사용할 수 있는 X509Certificate2Collection 개체입니다. 인증서 체인의 유효성을 검사하기 위해 추가 인증서를 사용해야 하는 경우 CheckSignature(Boolean)CheckSignature(X509Certificate2Collection, Boolean) 대신 사용합니다.

verifySignatureOnly
Boolean

서명자 인증서의 유효성은 검사하지 않고 디지털 서명의 안정성만 확인할 것인지 여부를 지정하는 Boolean 값입니다.

verifySignatureOnlytrue이면 디지털 서명의 안정성만 확인합니다. false이면 디지털 서명의 안정성을 확인하고 서명자 인증서의 유효성을 검사한 다음 인증서 용도의 유효성을 검사합니다. 인증서에 키 용도가 없거나 키 용도가 디지털 서명 또는 거부 불가능을 지원하는 경우 인증서 용도가 유효한 것으로 간주됩니다.

예외

null 참조를 유효한 인수로 사용하지 않는 메서드에 null 참조가 전달된 경우

암호화 작업을 완료할 수 없는 경우

개체의 현재 상태에서 메서드 호출을 사용할 수 없는 경우

설명

이 메서드는 CMS/PKCS #7 메시지에서 서명과 같은 모든 서명을 확인합니다. 메시지에 포함된 서명된 특성이 있는 경우 이러한 특성도 확인됩니다. 인증서의 유효성을 검사하는 옵션을 선택하면 인증서 체인의 포함된 전체 부분의 유효성이 검사됩니다.

이 메서드는 디지털 서명 확인에 실패하거나 유효성 검사 요구 사항이 충족되지 않는 경우 예외를 throw합니다.

적용 대상