C# 클래스 Microsoft.Xades.XadesSignedXml

Facade class for the XAdES signature library. The class inherits from the System.Security.Cryptography.Xml.SignedXml class and is backwards compatible with it, so this class can host xmldsig signatures and XAdES signatures. The property SignatureStandard will indicate the type of the signature: XMLDSIG or XAdES.
상속: System.Security.Cryptography.Xml.SignedXml
파일 보기 프로젝트 열기: Caliper/Xades 1 사용 예제들

공개 메소드들

메소드 설명
AddXadesObject ( XadesObject xadesObject ) : void

Add a XAdES object to the signature

CheckAllHashDataInfosInIndividualDataObjectsTimeStamp ( ) : bool

Check if the HashDataInfo of each IndividualDataObjectsTimeStamp points to existing Reference

CheckAllReferencesExistInAllDataObjectsTimeStamp ( ) : bool

Check if there is a HashDataInfo for each reference if there is a AllDataObjectsTimeStamp

CheckArchiveTimeStampHashDataInfos ( ) : bool

Check if all required HashDataInfos are present on ArchiveTimeStamp

CheckCertificateValuesMatchCertificateRefs ( ) : bool

Check if CertificateValues match CertificateRefs

CheckCounterSignatures ( XadesCheckSignatureMasks counterSignatureMask ) : bool

Perform XAdES checks on contained counter signatures. If couter signature is XMLDSIG, only XMLDSIG check (CheckSignature()) is done.

CheckCounterSignaturesReference ( ) : bool

Counter signatures should all contain a reference to the parent signature SignatureValue element

CheckHashDataInfoOfSignatureTimeStampPointsToSignatureValue ( ) : bool

Check if HashDataInfo of SignatureTimeStamp points to SignatureValue

CheckIfClaimedRolesOrCertifiedRolesPresentInSignerRole ( ) : bool

Check if at least ClaimedRoles or CertifiedRoles present in SignerRole

CheckObjectReferencesInCommitmentTypeIndication ( ) : bool

Check if each ObjectReference in CommitmentTypeIndication points to Reference element

CheckQualifyingProperties ( ) : bool

Check that QualifyingProperties occur in one Object, check that there is only one QualifyingProperties and that signed properties occur in one QualifyingProperties element

CheckQualifyingPropertiesTarget ( ) : bool

Check if the QualifyingProperties Target attribute points to the signature element

CheckRefsOnlyTimeStampHashDataInfos ( ) : bool

Check if all required HashDataInfos are present on RefsOnlyTimeStamp

CheckRevocationValuesMatchRevocationRefs ( ) : bool

Check if RevocationValues match RevocationRefs

CheckSameCertificate ( ) : bool

Check to see if first XMLDSIG certificate has same hashvalue as first XAdES SignatureCertificate

CheckSigAndRefsTimeStampHashDataInfos ( ) : bool

Check if all required HashDataInfos are present on SigAndRefsTimeStamp

CheckXadesCIsXadesT ( ) : bool

Check if a XAdES-C signature is also a XAdES-T signature

CheckXadesXLIsXadesX ( ) : bool

Check if a XAdES-XL signature is also a XAdES-X signature

CheckXmldsigSignature ( ) : bool

Check the signature of the underlying XMLDSIG signature

ComputeSignature ( ) : void

Copy of System.Security.Cryptography.Xml.SignedXml.ComputeSignature() which will end up calling our own GetC14NDigest with a namespace prefix for all XmlDsig nodes

GetIdElement ( XmlDocument xmlDocument, string idValue ) : XmlElement

Overridden virtual method to be able to find the nested SignedProperties element inside of the XAdES object

GetXml ( ) : XmlElement

Returns the XML representation of the this object

LoadXml ( System xmlElement ) : void

Load state from an XML element

ValidateAgainstSchema ( ) : bool

Validate the XML representation of the signature against the XAdES and XMLDSIG schemas

XadesCheckSignature ( XadesCheckSignatureMasks xadesCheckSignatureMasks ) : bool

Additional tests for XAdES signatures. These tests focus on XMLDSIG verification and correct form of the XAdES XML structure (schema validation and completeness as defined by the XAdES standard).

Because of the fact that the XAdES library is intentionally independent of standards like TSP (RFC3161) or OCSP (RFC2560), these tests do NOT include any verification of timestamps nor OCSP responses. These checks are important and have to be done in the application built on top of the XAdES library.

XadesSignedXml ( ) : System

Default constructor for the XadesSignedXml class

XadesSignedXml ( System signatureDocument ) : System

Constructor for the XadesSignedXml class

XadesSignedXml ( XmlElement signatureElement ) : System

Constructor for the XadesSignedXml class

비공개 메소드들

메소드 설명
BuildDigestedReferences ( ) : void

Copy of System.Security.Cryptography.Xml.SignedXml.BuildDigestedReferences() which will add a "ds" namespace prefix to all XmlDsig nodes

CheckHashDataInfoPointsToSignatureValue ( TimeStamp timeStamp ) : bool
CheckHashDataInfosExist ( TimeStamp timeStamp ) : bool
CheckHashDataInfosForTimeStamp ( TimeStamp timeStamp ) : bool
CheckHashDataInfosOfArchiveTimeStamp ( TimeStamp timeStamp ) : bool
CheckHashDataInfosOfRefsOnlyTimeStamp ( TimeStamp timeStamp ) : bool
CheckHashDataInfosOfSigAndRefsTimeStamp ( TimeStamp timeStamp ) : bool
CheckObjectReference ( ObjectReference objectReference ) : bool
GetC14NDigest ( HashAlgorithm hash ) : byte[]

We won't call System.Security.Cryptography.Xml.SignedXml.GetC14NDigest(), as we want to use our own.

GetC14NDigest ( HashAlgorithm hash, string prefix ) : byte[]

Copy of System.Security.Cryptography.Xml.SignedXml.GetC14NDigest() which will add a namespace prefix to all XmlDsig nodes

GetXadesDataObject ( ) : System.Security.Cryptography.Xml.DataObject
GetXadesObjectElement ( XmlElement signatureElement ) : XmlElement
SchemaValidationHandler ( object sender, ValidationEventArgs validationEventArgs ) : void
SetPrefix ( String prefix, XmlNode node ) : void
SetSignatureStandard ( XmlElement signatureElement ) : void
XmlValidationHandler ( object sender, ValidationEventArgs validationEventArgs ) : void

메소드 상세

AddXadesObject() 공개 메소드

Add a XAdES object to the signature
public AddXadesObject ( XadesObject xadesObject ) : void
xadesObject XadesObject XAdES object to add to signature
리턴 void

CheckAllHashDataInfosInIndividualDataObjectsTimeStamp() 공개 메소드

Check if the HashDataInfo of each IndividualDataObjectsTimeStamp points to existing Reference

CheckAllReferencesExistInAllDataObjectsTimeStamp() 공개 메소드

Check if there is a HashDataInfo for each reference if there is a AllDataObjectsTimeStamp
public CheckAllReferencesExistInAllDataObjectsTimeStamp ( ) : bool
리턴 bool

CheckArchiveTimeStampHashDataInfos() 공개 메소드

Check if all required HashDataInfos are present on ArchiveTimeStamp
public CheckArchiveTimeStampHashDataInfos ( ) : bool
리턴 bool

CheckCertificateValuesMatchCertificateRefs() 공개 메소드

Check if CertificateValues match CertificateRefs
public CheckCertificateValuesMatchCertificateRefs ( ) : bool
리턴 bool

CheckCounterSignatures() 공개 메소드

Perform XAdES checks on contained counter signatures. If couter signature is XMLDSIG, only XMLDSIG check (CheckSignature()) is done.
public CheckCounterSignatures ( XadesCheckSignatureMasks counterSignatureMask ) : bool
counterSignatureMask XadesCheckSignatureMasks Check mask applied to counter signatures
리턴 bool

CheckCounterSignaturesReference() 공개 메소드

Counter signatures should all contain a reference to the parent signature SignatureValue element
public CheckCounterSignaturesReference ( ) : bool
리턴 bool

CheckHashDataInfoOfSignatureTimeStampPointsToSignatureValue() 공개 메소드

Check if HashDataInfo of SignatureTimeStamp points to SignatureValue

CheckIfClaimedRolesOrCertifiedRolesPresentInSignerRole() 공개 메소드

Check if at least ClaimedRoles or CertifiedRoles present in SignerRole

CheckObjectReferencesInCommitmentTypeIndication() 공개 메소드

Check if each ObjectReference in CommitmentTypeIndication points to Reference element
public CheckObjectReferencesInCommitmentTypeIndication ( ) : bool
리턴 bool

CheckQualifyingProperties() 공개 메소드

Check that QualifyingProperties occur in one Object, check that there is only one QualifyingProperties and that signed properties occur in one QualifyingProperties element
public CheckQualifyingProperties ( ) : bool
리턴 bool

CheckQualifyingPropertiesTarget() 공개 메소드

Check if the QualifyingProperties Target attribute points to the signature element
public CheckQualifyingPropertiesTarget ( ) : bool
리턴 bool

CheckRefsOnlyTimeStampHashDataInfos() 공개 메소드

Check if all required HashDataInfos are present on RefsOnlyTimeStamp
public CheckRefsOnlyTimeStampHashDataInfos ( ) : bool
리턴 bool

CheckRevocationValuesMatchRevocationRefs() 공개 메소드

Check if RevocationValues match RevocationRefs
public CheckRevocationValuesMatchRevocationRefs ( ) : bool
리턴 bool

CheckSameCertificate() 공개 메소드

Check to see if first XMLDSIG certificate has same hashvalue as first XAdES SignatureCertificate
public CheckSameCertificate ( ) : bool
리턴 bool

CheckSigAndRefsTimeStampHashDataInfos() 공개 메소드

Check if all required HashDataInfos are present on SigAndRefsTimeStamp
public CheckSigAndRefsTimeStampHashDataInfos ( ) : bool
리턴 bool

CheckXadesCIsXadesT() 공개 메소드

Check if a XAdES-C signature is also a XAdES-T signature
public CheckXadesCIsXadesT ( ) : bool
리턴 bool

CheckXadesXLIsXadesX() 공개 메소드

Check if a XAdES-XL signature is also a XAdES-X signature
public CheckXadesXLIsXadesX ( ) : bool
리턴 bool

CheckXmldsigSignature() 공개 메소드

Check the signature of the underlying XMLDSIG signature
public CheckXmldsigSignature ( ) : bool
리턴 bool

ComputeSignature() 공개 메소드

Copy of System.Security.Cryptography.Xml.SignedXml.ComputeSignature() which will end up calling our own GetC14NDigest with a namespace prefix for all XmlDsig nodes
public ComputeSignature ( ) : void
리턴 void

GetIdElement() 공개 메소드

Overridden virtual method to be able to find the nested SignedProperties element inside of the XAdES object
public GetIdElement ( XmlDocument xmlDocument, string idValue ) : XmlElement
xmlDocument System.Xml.XmlDocument Document in which to find the Id
idValue string Value of the Id to look for
리턴 System.Xml.XmlElement

GetXml() 공개 메소드

Returns the XML representation of the this object
public GetXml ( ) : XmlElement
리턴 System.Xml.XmlElement

LoadXml() 공개 메소드

Load state from an XML element
public LoadXml ( System xmlElement ) : void
xmlElement System The XML element from which to load the XadesSignedXml state
리턴 void

ValidateAgainstSchema() 공개 메소드

Validate the XML representation of the signature against the XAdES and XMLDSIG schemas
public ValidateAgainstSchema ( ) : bool
리턴 bool

XadesCheckSignature() 공개 메소드

Additional tests for XAdES signatures. These tests focus on XMLDSIG verification and correct form of the XAdES XML structure (schema validation and completeness as defined by the XAdES standard).
Because of the fact that the XAdES library is intentionally independent of standards like TSP (RFC3161) or OCSP (RFC2560), these tests do NOT include any verification of timestamps nor OCSP responses. These checks are important and have to be done in the application built on top of the XAdES library.
Thrown when the signature is not /// a XAdES signature. SignatureStandard should be equal to /// KnownSignatureStandard.Xades. /// Use the CheckSignature method for non-XAdES signatures.
public XadesCheckSignature ( XadesCheckSignatureMasks xadesCheckSignatureMasks ) : bool
xadesCheckSignatureMasks XadesCheckSignatureMasks Bitmask to indicate which /// tests need to be done. This function will call a public virtual /// methods for each bit that has been set in this mask. /// See the XadesCheckSignatureMasks /// enum for the bitmask definitions. The virtual test method associated /// with a bit in the mask has the same name as enum value name.
리턴 bool

XadesSignedXml() 공개 메소드

Default constructor for the XadesSignedXml class
public XadesSignedXml ( ) : System
리턴 System

XadesSignedXml() 공개 메소드

Constructor for the XadesSignedXml class
public XadesSignedXml ( System signatureDocument ) : System
signatureDocument System XmlDocument used to create the instance
리턴 System

XadesSignedXml() 공개 메소드

Constructor for the XadesSignedXml class
public XadesSignedXml ( XmlElement signatureElement ) : System
signatureElement System.Xml.XmlElement XmlElement used to create the instance
리턴 System