public class InhibitAnyPolicy extends V3Extension
InhibitAnyPolicy extension.
The InhibitAnyPolicy extension is a standard X509v3 extension.
Each extension is associated with a specific certificateExtension
object identifier, derived from:
certificateExtension OBJECT IDENTIFIER ::=
{joint-iso-ccitt(2) ds(5) 29}
id-ce OBJECT IDENTIFIER ::= certificateExtension
The object identifier for the InhibitAnyPolicy extension
is defined as:
id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::= { id-ce 54 }
which corresponds to the OID string "2.5.29.54".
This extension indicates that the special anyPolicy OID, with the value { 2 5 29 32 0 }, is not considered an explicit match for other certificate policies. The valie indicates the number of additional certificates that may appear in the path before anyPolicy is no longer permitted.
InhibitAnyPolicy ::= SkipCerts
SkipCerts ::= INTEGER (0..MAX)
More information can be found in RFC 3280, section 4.2.1.15 "Inhibit Any-Policy".
For adding a InhibitAnyPolicy extension object to a X509Certificate,
use the addExtension method of the iaik.x509.X509Certificate class, e.g.:
InhibitAnyPolicy inhibitAnyPolicy = new InhibitAnyPolicy(); inhibitAnyPolicy.setInhibitAnyPolicy(3); X509Certificate cert = new X509Certificate(); ... cert.addExtension(inhibitAnyPolicy);
When intending to mark this extension as critical, use the setCritical
method of the iaik.x509.V3Extension
parent class (note that you have to mark an extension as critical before adding the
extension to a certificate), e.g.:
inhibitAnyPolicy.setCritical(true);
V3Extension,
X509Extensions,
X509Certificate| Modifier and Type | Field and Description |
|---|---|
static ObjectID |
oid
The object identifier of this InhibitAnyPolicy extension.
|
critical| Constructor and Description |
|---|
InhibitAnyPolicy()
Default constructor.
|
InhibitAnyPolicy(int skipCerts)
Creates a new
InhibitAnyPolicy from an integer specifying the
number of additional certificates that may appear in the path before
anyPolicy is no longer permitted. |
| Modifier and Type | Method and Description |
|---|---|
int |
getInhibitAnyPolicy()
Returns the value of this
InhibitAnyPolicy extension
specifying the number of additional certificates that may appear in the path
before anyPolicy is no longer permitted. |
ObjectID |
getObjectID()
Returns the object ID of this
InhibitAnyPolicy extension |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Inits the implementation with an ASN1Object.
|
void |
setInhibitAnyPolicy(int inhibitAnyPolicy)
Sets the value of this
InhibitAnyPolicy extension for
specifying the number of additional certificates that may appear in the path
before anyPolicy is no longer permitted. |
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
InhibitAnyPolicy
extension object. |
java.lang.String |
toString()
Returns a string that represents the contents of this
InhibitAnyPolicy extension. |
getName, isCritical, setCriticalpublic static final ObjectID oid
public InhibitAnyPolicy()
InhibitAnyPolicy object.
Use the setInhibitAnyPolicy method for
explicitly setting the inhibit anyPolicy, e.g.:
InhibitAnyPolicy inhibit_anyPolicy = new InhibitAnyPolicy(); inhibit_anyPolicy.setInhibitAnyPolicy(2);
public InhibitAnyPolicy(int skipCerts)
InhibitAnyPolicy from an integer specifying the
number of additional certificates that may appear in the path before
anyPolicy is no longer permitted.
For instance:
InhibitAnyPolicy inhibit_anyPolicy = new InhibitAnyPolicy(2);
skipCerts - the the number of additional certificates that may appear
in the path before anyPolicy is no longer permitted.public void init(ASN1Object obj) throws X509ExtensionException
V3ExtensionX509Extensions class when parsing the ASN.1 representation
of a certificate (or a CRL) for properly initializing any
included extension. This method initilaizes a specific
extension only with its value, but not with its critical
specification. For that reason, this method shall not be
explicitly called by an application.init in class V3Extensionobj - the extension value as ASN1ObjectX509ExtensionException - if the extension could not parse the ASN1Objectpublic void setInhibitAnyPolicy(int inhibitAnyPolicy)
InhibitAnyPolicy extension for
specifying the number of additional certificates that may appear in the path
before anyPolicy is no longer permitted.inhibitAnyPolicy - the number of additional certificates
that may appear in the path before anyPolicy
is no longer permitted.getInhibitAnyPolicy()public int getInhibitAnyPolicy()
InhibitAnyPolicy extension
specifying the number of additional certificates that may appear in the path
before anyPolicy is no longer permitted.setInhibitAnyPolicy(int)public ASN1Object toASN1Object()
InhibitAnyPolicy
extension object.
The returned ASN1Object is an ASN.1 INTEGER representing the BigInteger skipCerts value.
SkipCerts ::= INTEGER (0..MAX)
toASN1Object in class V3ExtensionInhibitAnyPolicy as ASN1Objectpublic int hashCode()
hashCode in class V3Extensionpublic ObjectID getObjectID()
InhibitAnyPolicy extensiongetObjectID in class V3Extensionpublic java.lang.String toString()
InhibitAnyPolicy extension.toString in class java.lang.Object