public class X509KeyUsage extends AbstractX509Extension
http://tools.ietf.org/html/rfc5280
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
X509KeyUsage(mybouncycastle.org.bouncycastle.asn1.ASN1Sequence 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.
|
Modifier and Type | Method and Description |
---|---|
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) |
equals, getBCExtension, getDEROctets, getIdentifier, getInstance, hashCode, isCritical, toString
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
public X509KeyUsage(int a_usage)
a_usage
- org.bouncycastle.asn1.x509.KeyUsage;
public X509KeyUsage(mybouncycastle.org.bouncycastle.asn1.ASN1Sequence a_extension)
a_extension
- the extions as ASN1Sequenceprivate static byte[] createDEROctet(int usage)
usage
- the allowed usages of this certificatepublic 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 usageprivate 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()
Copyright © 2023. All rights reserved.