FileDocCategorySizeDatePackage
KeyUsage.javaAPI DocAndroid 1.5 API1914Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509

KeyUsage

public class KeyUsage extends org.bouncycastle.asn1.DERBitString
The KeyUsage object.
id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }

KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1),
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }

Fields Summary
public static final int
digitalSignature
public static final int
nonRepudiation
public static final int
keyEncipherment
public static final int
dataEncipherment
public static final int
keyAgreement
public static final int
keyCertSign
public static final int
cRLSign
public static final int
encipherOnly
public static final int
decipherOnly
Constructors Summary
public KeyUsage(int usage)
Basic constructor.

param
usage - the bitwise OR of the Key Usage flags giving the allowed uses for the key. e.g. (KeyUsage.keyEncipherment | KeyUsage.dataEncipherment)


                                  
     
         
    
        super(getBytes(usage), getPadBits(usage));
    
public KeyUsage(org.bouncycastle.asn1.DERBitString usage)

        super(usage.getBytes(), usage.getPadBits());
    
Methods Summary
public java.lang.StringtoString()

        if (data.length == 1)
        {
            return "KeyUsage: 0x" + Integer.toHexString(data[0] & 0xff);
        }
        return "KeyUsage: 0x" + Integer.toHexString((data[1] & 0xff) << 8 | (data[0] & 0xff));