|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.crypto.AbstractX509Extension anon.crypto.X509KeyUsage
public class X509KeyUsage
This class implements the KeyUsage extension for X.509-certificates as specified in RFC 5280.
http://tools.ietf.org/html/rfc5280
Field Summary | |
---|---|
static int |
CRL_SIGN
|
static int |
DATA_ENCIPHERMENT
|
static int |
DECIPHER_ONLY
|
static int |
DIGITAL_SIGNATURE
|
static int |
ENCIPHER_ONLY
|
static java.lang.String |
IDENTIFIER
|
static int |
KEY_AGREEMENT
|
static int |
KEY_CERT_SIGN
|
static int |
KEY_ENCIPHERMENT
|
private int |
m_usage
a vector containing |
static int |
NON_REPUDIATION
|
private static java.lang.String |
TXT_CRL_SIGN
|
private static java.lang.String |
TXT_DATA_ENCIPHERMENT
|
private static java.lang.String |
TXT_DECIPHER_ONLY
|
private static java.lang.String |
TXT_DIGITAL_SIGNATURE
the Strings for the different KeyUsages as specified by RFC 5280 |
private static java.lang.String |
TXT_ENCIPHER_ONLY
|
private static java.lang.String |
TXT_KEY_AGREEMENT
|
private static java.lang.String |
TXT_KEY_CERT_SIGN
|
private static java.lang.String |
TXT_KEY_ENCIPHERMENT
|
private static java.lang.String |
TXT_NON_REPUDIATION
|
private static int[] |
USAGES
the different KeyUsage values packed into an array for easier Parsing |
Constructor Summary | |
---|---|
X509KeyUsage(org.bouncycastle.asn1.DERSequence a_extension)
Creates an new X509KeyUsage object from a BouncyCastle DERSequence |
|
X509KeyUsage(int a_usage)
Creates a new X509KeyUsage object from the specified usage integer. |
Method Summary | |
---|---|
boolean |
allowsCRLSign()
|
boolean |
allowsDataEncipherment()
|
boolean |
allowsDecipherOnly()
|
boolean |
allowsDigitalSignature()
|
boolean |
allowsEncipherOnly()
|
boolean |
allowsKeyAgreement()
|
boolean |
allowsKeyCertSign()
|
boolean |
allowsKeyEncipherment()
|
boolean |
allowsNonRepudiation()
|
private static byte[] |
createDEROctet(int usage)
Generates the DEROctets of this extension to hand over to the super class. |
private void |
createValue()
reads the usage-integer from the DEROctets of this extension. |
java.lang.String |
getName()
Returns the human-readable name of this extension. |
java.lang.String |
getUsageString(int a_usage)
Translate a single usage-bitstring (no combination) into a human-readable String. |
java.util.Vector |
getValues()
This method returns all values of this extension in separated String objects. |
boolean |
isAllowedUsage(int a_usage)
|
Methods inherited from class anon.crypto.AbstractX509Extension |
---|
equals, getBCExtension, getDEROctets, getIdentifier, getInstance, hashCode, isCritical, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String IDENTIFIER
public static final int DIGITAL_SIGNATURE
public static final int NON_REPUDIATION
public static final int KEY_ENCIPHERMENT
public static final int DATA_ENCIPHERMENT
public static final int KEY_AGREEMENT
public static final int KEY_CERT_SIGN
public static final int CRL_SIGN
public static final int ENCIPHER_ONLY
public static final int DECIPHER_ONLY
private static final java.lang.String TXT_DIGITAL_SIGNATURE
private static final java.lang.String TXT_NON_REPUDIATION
private static final java.lang.String TXT_KEY_ENCIPHERMENT
private static final java.lang.String TXT_DATA_ENCIPHERMENT
private static final java.lang.String TXT_KEY_AGREEMENT
private static final java.lang.String TXT_KEY_CERT_SIGN
private static final java.lang.String TXT_CRL_SIGN
private static final java.lang.String TXT_ENCIPHER_ONLY
private static final java.lang.String TXT_DECIPHER_ONLY
private static final int[] USAGES
private int m_usage
Constructor Detail |
---|
public X509KeyUsage(int a_usage)
a_usage
- org.bouncycastle.asn1.x509.KeyUsage;
public X509KeyUsage(org.bouncycastle.asn1.DERSequence a_extension)
a_extension
- the extions as DERSequenceMethod Detail |
---|
private static byte[] createDEROctet(int usage)
usage
- the allowed usages of this certificate
public java.lang.String getName()
AbstractX509Extension
getName
in class AbstractX509Extension
public java.util.Vector getValues()
AbstractX509Extension
getValues
in class AbstractX509Extension
public java.lang.String getUsageString(int a_usage)
a_usage
- a single usage
private void createValue()
public boolean isAllowedUsage(int a_usage)
a_usage
- a (combination of) usage(s) to test against the extension's allowed
usages.
true
if all of the usages are allowed or false
otherwise.public boolean allowsDigitalSignature()
public boolean allowsNonRepudiation()
public boolean allowsKeyEncipherment()
public boolean allowsDataEncipherment()
public boolean allowsKeyAgreement()
public boolean allowsKeyCertSign()
public boolean allowsCRLSign()
public boolean allowsEncipherOnly()
public boolean allowsDecipherOnly()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |