|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--iaik.asn1.structures.AttributeValue
|
+--iaik.pkcs.pkcs9.ChallengePassword
The PKCS#9 ChallengePassword attribute.
PKCS#9 specifies
the ChallengePassword attribute to may be included in a PKCS#10 CertificateRequest to specify a password by
which an entity may request certificate revocation:
challengePassword ATTRIBUTE ::= {
WITH SYNTAX DirectoryString {pkcs-9-ub-challengePassword}
EQUALITY MATCHING RULE caseExactMatch
SINGLE VALUE TRUE
ID pkcs-9-at-challengePassword
}
PKCS#9 recommends to use use the PrintableString DirectoryString whenever possible,
otherwise UTF8String should be used.
The following example sets a ChallengePassword attribute for a certificate request:
CertificateRequest request = ...;
Attribute[] attributes = new Attribute[1];
// add a ChallengePassword attribute
ChallengePassword challengePassword = new ChallengePassword("myPassword");
attributes[0] = new Attribute(challengePassword);
// now set the attributes
request.setAttributes(attributes);
On the receiving end, the CA may query for an ChallengePassword attribute included in
the certificate request:
CertificateRequest request = new CertificateRequest(is);
// verify the request
if (request.verify()) {
System.out.println("CertificateRequest verify ok.");
} else {
throw new RuntimeException("CertificateRequest verify error.");
}
// look for an ChallengePassword included
ChallengePassword challengePassword = (ChallengePassword)request.getAttributeValue(ChallengePassword.oid);
if (challengePassword != null) {
String password = challengePassword.getPassword();
...
}
Attribute,
AttributeValue,
CertificateRequest| Field Summary | |
static ObjectID |
oid
The attributeType object identifier of the PKCS#9 ChallengePassword attribute. |
| Constructor Summary | |
ChallengePassword()
Default constructor. |
|
ChallengePassword(ASN1Object obj)
Creates a ChallengePassword from its ASN.1 representation. |
|
ChallengePassword(ASN1String password)
Creates a ChallengePassword from the given password. |
|
ChallengePassword(String password)
Creates a ChallengePassword from the given passowrd. |
|
| Method Summary | |
void |
decode(ASN1Object obj)
Decodes the given ASN.1 ChallengePassword object for parsing
the internal structure. |
ObjectID |
getAttributeType()
Returns the OID (1.2.840.113549.1.9.7) identifying the ChallengePassword attribute type. |
String |
getPassword()
Gets the challenge password. |
ASN1Object |
toASN1Object()
Returns this ChallengePassword as ASN1Object. |
String |
toString()
Returns a string representation of this ChallengePassword. |
| Methods inherited from class iaik.asn1.structures.AttributeValue |
getName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final ObjectID oid
| Constructor Detail |
public ChallengePassword()
public ChallengePassword(String password)
PrintableString if the supplied password contains only printable characters,
otherwise it will be encoded as UTF8String.password - the challenge passwordpublic ChallengePassword(ASN1String password)
The password has to be supplied as ASN1String. However, please be aware that this constructor does not check if the supplied ASN1 String actually represents a DirectoryString:
DirectoryString ::= CHOICE {
teletexString TeletexString (SIZE (1..MAX)),
printableString PrintableString (SIZE (1..MAX)),
universalString UniversalString (SIZE (1..MAX)),
utf8String UTF8String (SIZE (1..MAX)),
bmpString BMPString (SIZE(1..MAX)) }
password - the challenge password as ASN.1 string
public ChallengePassword(ASN1Object obj)
throws CodingException
the - ChallengePassword as ASN1ObjectCodingException - if the ASN1Object is not an ASN1String| Method Detail |
public String getPassword()
public void decode(ASN1Object obj)
throws CodingException
ChallengePassword object for parsing
the internal structure.obj - the ChallengePassword as ASN1ObjectCodingException - if the ASN1Object is not an ASN1Stringpublic ASN1Object toASN1Object()
public ObjectID getAttributeType()
getAttributeType in class AttributeValuepublic String toString()
toString in class AttributeValue
|
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 | ||||||||
IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK