public class CertIDImpl extends XadesDOMStructure implements CertID, DOMURIReference
CertID
element which supports the DOM
XML representation and marshaling mechanism.Constructor and Description |
---|
CertIDImpl(DOMCryptoContext context,
Node node)
Creates a new instance of this
CertIDImpl with the given
context and node. |
CertIDImpl(String uri,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
byte[] digestValue,
IssuerSerialImpl issuerSerial)
Creates a new instance of this
CertIDImpl with the specified
config, URI reference, digest method, digest value and issuer DN and serial
number. |
CertIDImpl(String uri,
IssuerSerialImpl issuerSerial,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod,
InputStream digestInput)
Creates a new instance of this
CertIDImpl with the specified
provider config, URI reference, issuer DN and serial number and input for
the digest computation. |
CertIDImpl(String uri,
X509Certificate certificate,
iaik.xml.crypto.dsig.DigestMethodImpl digestMethod)
Creates a new instance of this
CertIDImpl 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() |
IssuerSerial |
getIssuerSerial()
Returns the
IssuerSerial . |
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 CertIDImpl(DOMCryptoContext context, Node node) throws MarshalException
CertIDImpl
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 CertIDImpl(String uri, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, byte[] digestValue, IssuerSerialImpl issuerSerial)
CertIDImpl
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 numberNullPointerException
- if config
, digestMethod
,
digestValue
or issuerSerial
is
null
IllegalArgumentException
- if uri
is not RFC 2396 complaintIllegalArgumentException
- if both uri
and digestValue
are
null
public CertIDImpl(String uri, X509Certificate certificate, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod)
CertIDImpl
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 methodNullPointerException
- if config
, certificate
or
digestMethod
is null
IllegalArgumentException
- if certificate
is not a valid X509 certificatepublic CertIDImpl(String uri, IssuerSerialImpl issuerSerial, iaik.xml.crypto.dsig.DigestMethodImpl digestMethod, InputStream digestInput)
CertIDImpl
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 numberdigestMethod
- the digest methoddigestInput
- the input for the digest computationNullPointerException
- if issuerSerial
, digestMethod
or
digestInput
is null
public IssuerSerial getIssuerSerial()
CertID
IssuerSerial
.getIssuerSerial
in interface CertID
IssuerSerial
CertID.getIssuerSerial()
public DigestAlgAndValue getCertDigest()
CertID
CertDigest
.getCertDigest
in interface CertID
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()
CertID
getURI
in interface CertID
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
CertID
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 CertID
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