public class CertIDV2Impl extends XadesDOMStructure implements CertIDV2, DOMURIReference
CertIDV2
element which supports the DOM
XML representation and marshaling mechanism.implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED
LOCAL_NAME, REGISTER_NAME
Constructor and Description |
---|
CertIDV2Impl(DOMCryptoContext context,
Node node)
Creates a new instance of this
CertIDV2Impl with the given
context and node. |
CertIDV2Impl(String uri,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
byte[] digestValue)
Creates a new instance of this
CertIDV2Impl with the specified
config, URI reference, digest method, digest value and issuer DN and serial
number. |
CertIDV2Impl(String uri,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
byte[] digestValue,
IssuerSerialV2Impl issuerSerial)
Creates a new instance of this
CertIDV2Impl with the specified
config, URI reference, digest method, digest value and issuer DN and serial
number. |
CertIDV2Impl(String uri,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
InputStream digestInput)
Creates a new instance of this
CertIDV2Impl with the specified
provider config, URI reference and input for
the digest computation. |
CertIDV2Impl(String uri,
IssuerSerialV2Impl issuerSerial,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
InputStream digestInput)
Creates a new instance of this
CertIDV2Impl with the specified
provider config, URI reference, issuer DN and serial number and input for
the digest computation. |
CertIDV2Impl(String uri,
X509Certificate certificate,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
boolean addIssuerSerial)
Creates a new instance of this
CertIDV2Impl with the specified
provider config, URI reference, certificate and digest method. |
Modifier and Type | Method and Description |
---|---|
DigestAlgAndValue |
getCertDigest()
Returns the
CertDigest . |
protected List |
getChildStructures() |
Node |
getHere() |
IssuerSerialV2 |
getIssuerSerialV2()
Returns the
IssuerSerialV2 . |
String |
getLocalName() |
String |
getType() |
String |
getURI()
Returns the URI reference.
|
Node |
marshal(DOMCryptoContext context,
Node parent,
Node nextSibling) |
protected void |
marshalAttributes(DOMCryptoContext context,
Element parent) |
protected void |
putChildStructure(iaik.xml.crypto.dom.DOMStructure childStructure) |
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context) |
boolean |
validate(XMLCryptoContext context,
Data digestInput)
Validates the digest value.
|
getInstance, getNamespace, getParentQualifyingPropertiesOf, getParentSignatureOf
addBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getImplClass, getInstance, getInstance, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshalElement, marshalIDAttribute, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalElement, unmarshalIDAttribute, unmarshalStructures, wrapNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFeatureSupported
public CertIDV2Impl(DOMCryptoContext context, Node node) throws MarshalException
CertIDV2Impl
with the given
context and node.context
- the contextnode
- the node to unmarshal fromNullPointerException
- if config
, context
or node
is null
MarshalException
- if an exception occurs during unmarshalingpublic CertIDV2Impl(String uri, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, byte[] digestValue)
CertIDV2Impl
with the specified
config, URI reference, digest method, digest value and issuer DN and serial
number.
If digestValue
is null
, the digest value is
computed on the data dereferenced from uri
.
uri
- the URI reference of a copy of the certificate (may be
null
)digestMethod
- the digest methoddigestValue
- the digest valueNullPointerException
- if uri
, digestMethod
or
digestValue
IllegalArgumentException
- if uri
is not RFC 2396 complaintIllegalArgumentException
- if digestMethod
or digestValue
are
null
public CertIDV2Impl(String uri, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, byte[] digestValue, IssuerSerialV2Impl issuerSerial)
CertIDV2Impl
with the specified
config, URI reference, digest method, digest value and issuer DN and serial
number.
If digestValue
is null
, the digest value is
computed on the data dereferenced from uri
.
uri
- the URI reference of a copy of the certificate (may be
null
)digestMethod
- the digest methoddigestValue
- the digest valueissuerSerial
- the issuer DN and serial number or null
, if no
IssuerSerial
sould be added to this CertIDV2
NullPointerException
- if uri
, digestMethod
or
digestValue
IllegalArgumentException
- if uri
is not RFC 2396 complaintIllegalArgumentException
- if digestMethod
or digestValue
are
null
public CertIDV2Impl(String uri, X509Certificate certificate, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, boolean addIssuerSerial)
CertIDV2Impl
with the specified
provider config, URI reference, certificate and digest method.uri
- the URI reference of a copy of the certificate (may be
null
)certificate
- the X509 certificatedigestMethod
- the digest methodaddIssuerSerial
- true
if IssuerSerial
sould be added to
this CertIDV2
, otherwise false
NullPointerException
- if certificate
or digestMethod
is null
IllegalArgumentException
- if certificate
is not a valid X509 certificatepublic CertIDV2Impl(String uri, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, InputStream digestInput)
CertIDV2Impl
with the specified
provider config, URI reference and input for
the digest computation.uri
- the URI reference (may be null
)digestMethod
- the digest methoddigestInput
- the input for the digest computationNullPointerException
- if digestMethod
or
digestInput
is null
public CertIDV2Impl(String uri, IssuerSerialV2Impl issuerSerial, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, InputStream digestInput)
CertIDV2Impl
with the specified
provider config, URI reference, issuer DN and serial number and input for
the digest computation.uri
- the URI reference (may be null
)issuerSerial
- the issuer DN and serial number or null
, if no
IssuerSerial
sould be added to this CertIDV2
digestMethod
- the digest methoddigestInput
- the input for the digest computationNullPointerException
- if digestMethod
or
digestInput
is null
public IssuerSerialV2 getIssuerSerialV2()
CertIDV2
IssuerSerialV2
.getIssuerSerialV2
in interface CertIDV2
IssuerSerialV2
. Maybe null
.CertIDV2.getIssuerSerialV2()
public DigestAlgAndValue getCertDigest()
CertIDV2
CertDigest
.getCertDigest
in interface CertIDV2
CertDigest
CertID.getCertDigest()
public Node getHere()
getHere
in interface DOMURIReference
getHere
in class iaik.xml.crypto.dom.DOMStructure
{@inheritDoc}
public String getType()
getType
in interface URIReference
URIReference.getType()
public String getURI()
CertIDV2
getURI
in interface CertIDV2
getURI
in interface URIReference
URIReference.getURI()
public String getLocalName()
getLocalName
in class iaik.xml.crypto.dom.DOMStructure
DOMStructure.getLocalName()
protected List getChildStructures()
getChildStructures
in class iaik.xml.crypto.dom.DOMStructure
DOMStructure.getChildStructures()
protected void putChildStructure(iaik.xml.crypto.dom.DOMStructure childStructure) throws MarshalException
putChildStructure
in class iaik.xml.crypto.dom.DOMStructure
MarshalException
DOMStructure.putChildStructure(DOMStructure)
protected void marshalAttributes(DOMCryptoContext context, Element parent) throws MarshalException
marshalAttributes
in class iaik.xml.crypto.dom.DOMStructure
parent
- MarshalException
DOMStructure.marshalAttributes(DOMCryptoContext,
Element)
protected void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
unmarshalAttributes
in class iaik.xml.crypto.dom.DOMStructure
MarshalException
DOMStructure.unmarshalAttributes(org.w3c.dom.NamedNodeMap,
DOMCryptoContext)
public Node marshal(DOMCryptoContext context, Node parent, Node nextSibling) throws MarshalException
marshal
in class iaik.xml.crypto.dom.DOMStructure
MarshalException
DOMStructure.marshal(DOMCryptoContext, Node, Node)
public boolean validate(XMLCryptoContext context, Data digestInput) throws XMLSignatureException
CertIDV2
The input for the digest computation is obtained from the given
digestInput
if present, or alternatively from the dereferenced
URI reference of the CertID
. If no digestInput
is
given or no URI reference is present or could be dereferenced successfully
an XMLSignatureException
is thrown. If no digestInput
is given the method only validates the reference the first time it is
invoked. On subsequent invocations, it returns a cached result unless a
digestinput is provided.
validate
in interface CertIDV2
context
- the validation contextdigestInput
- the input for the digest computationtrue
if the digest value validated successfully;
false
otherwiseXMLSignatureException
- if an unexpected exception occurs while validating the digest valueCertID.validate(javax.xml.crypto.XMLCryptoContext,
javax.xml.crypto.Data)
© 2002-2005 IAIK, © 2004, 2006 - 2017 Stiftung SIC