|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.x509.attr.Holder
This class implements the AC type Holder
.
The
Internet Attribute Certificate Profile for Authorization
(RFC 3281) specifies the Holder
type for identifying the entity to
which the AttributeCertificate
belongs:
Holder ::= SEQUENCE { baseCertificateID [0] IssuerSerial OPTIONAL, -- the issuer and serial number of -- the holder's Public Key Certificate entityName [1] GeneralNames OPTIONAL, -- the name of the claimant or role objectDigestInfo [2] ObjectDigestInfo OPTIONAL -- used to directly authenticate the holder, -- for example, an executable }For any environment where the AC is passed in an authenticated message or session and where the authentication is based on the use of an X.509 public key certificate, the holder should be identified by means of a
baseCertificateID
pointing to the right X.509 public key certificate by issuer name
and issuer-specific serial number, e.g.:
X509Certificate baseCert = ...; IssuerSerial baseCertificateID = new IssuerSerial(baseCert); Holder holder = new Holder(); holder.setBaseCertificateID(baseCertificateID); attributeCertificate.setHolder(holder);
entityName
option and the underlying authentication is based on a PKC,
then the entityName MUST be the same as the PKC subject field or one of
the values of the PKC subjectAltName field extension (if present), e.g.:
X509Certificate cert = ...; Name subject = (Name)cert.getSubjectDN(); GeneralName subjectName = new GeneralName(GeneralName.directoryName, subject); GeneralNames entityName = new GeneralNames(subjectName); Holder holder = new Holder(); holder.setEntityName(entityName); attributeCertificate.setHolder(holder);The
ObjectDigestInfo
component may be
used for linking the AC to an object by placing a hash of that
object into the holder field of the AC. For example, this allows
production of ACs that are linked to public keys rather than names
(see RFC 3281 for
more information):
// the public key to which to link the AC: PublicKey publicKey = ...; // the digest algorithm to use AlgorithmID digestAlgorithm = ...; ObjectDigestInfo odi = new ObjectDigestInfo(publicKey, digestAlgorithm); Holder holder = new Holder(); holder.setObjectDigestInfo(odi); attributeCertificate.setHolder(holder);
AttributeCertificate
,
IssuerSerial
,
ObjectDigestInfo
,
GeneralNames
Constructor Summary | |
Holder()
Default constructor. |
|
Holder(ASN1Object obj)
Creates a Holder from its ASN.1 representation. |
Method Summary | |
boolean |
equals(Object obj)
Compares this Holder to the specified object. |
IssuerSerial |
getBaseCertificateID()
Gets the baseCertificateID of this Holder, if set. |
GeneralNames |
getEntityName()
Gets the entityName of this Holder, if set. |
ObjectDigestInfo |
getObjectDigestInfo()
Gets the objectDigestInfo of this Holder, if set. |
int |
hashCode()
Returns a hashcode for this Holder. |
boolean |
identifiesCert(X509Certificate cert)
Checks if this Holder identifies the certificate. |
void |
setBaseCertificateID(IssuerSerial baseCertificateID)
Sets the baseCertificateID of this Holder. |
void |
setEntityName(GeneralNames entityName)
Sets the entityName of this Holder. |
void |
setObjectDigestInfo(ObjectDigestInfo objectDigestInfo)
Sets the objectDigestInfo of this Holder. |
ASN1Object |
toASN1Object()
Returns this Holder as ASN1Object. |
String |
toString()
Returns a string giving some information about this Holder object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Holder()
Holder
object. Use the several
setXXX
method for setting the fields of this
Holder object.public Holder(ASN1Object obj) throws CodingException
obj
- the Holder as ASN1ObjectCodingException
- if an decoding/parsing error occurs or the
the information contained is not appropriate
for a HolderMethod Detail |
public IssuerSerial getBaseCertificateID()
public void setBaseCertificateID(IssuerSerial baseCertificateID)
the
- baseCertificateID IssuerSerial to be set.public GeneralNames getEntityName()
public void setEntityName(GeneralNames entityName)
the
- entityName GeneralNames to be set.public ObjectDigestInfo getObjectDigestInfo()
public void setObjectDigestInfo(ObjectDigestInfo objectDigestInfo)
the
- objectDigestInfo to be set.public ASN1Object toASN1Object()
public boolean equals(Object obj)
Holder
to the specified object.equals
in class Object
obj
- the object to compare this Holder
against.true
, if the given object is equal to this
Holder
,
false
otherwisepublic int hashCode()
hashCode
in class Object
public boolean identifiesCert(X509Certificate cert) throws NoSuchAlgorithmException, CertificateEncodingException
In the case where the Holder of an AC is linked to particular certificate this method may be used for checking if the given cert "belongs" to this Holder by performing the following steps in the following order:
IssuerSerial
identifies
the given certificate, this method returns true
; if the
corresponding IssuerSerial does not identify the given certificate,
this method returns false
true
; if the
entityName does not correspond to the subject of the given certificate,
this method returns false
.
ObjectDigestInfo
identifies
the given certificate, this method returns true
; if the
corresponding ObjectDigestInfo does not identify the given certificate,
this method returns false
false
true
if this Holder "links" to the given certificate according
to the rules above, false
if notNoSuchAlgorithmException
- if this Holder only contains the objectDigestInfo
component, but the digest algorithm (required for
the check) used there is not supportedCertificateEncodingException
- if this Holder only contains the objectDigestInfo
and an error occurs while encoding
the certificate required for digest
calculationpublic String toString()
Holder
object.toString
in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |