org.mozilla.jss.pkcs11

Class PK11SymKey

public final class PK11SymKey extends Object implements SymmetricKey

Constructor Summary
protected PK11SymKey(byte[] pointer)
Method Summary
StringgetAlgorithm()
byte[]getEncoded()
StringgetFormat()
byte[]getKeyData()
KeyTypegetKeyType()
intgetLength()
Returns the length of the key in bytes, as returned by PK11_GetKeyLength().
CryptoTokengetOwningToken()
intgetStrength()
Returns key strength, measured as the number of bits of secret material.
SymmetricKey.TypegetType()

Constructor Detail

PK11SymKey

protected PK11SymKey(byte[] pointer)

Method Detail

getAlgorithm

public String getAlgorithm()

getEncoded

public byte[] getEncoded()

getFormat

public String getFormat()

getKeyData

public byte[] getKeyData()

getKeyType

public KeyType getKeyType()

getLength

public int getLength()
Returns the length of the key in bytes, as returned by PK11_GetKeyLength().

getOwningToken

public CryptoToken getOwningToken()

getStrength

public int getStrength()
Returns key strength, measured as the number of bits of secret material. NOTE: Due to a bug in the security library (333440), this may return a wrong answer for PBE keys that have embedded parity (like DES). A DES key is 56 bits of information plus 8 bits of parity, so it takes up 64 bits. For a normal DES key, this method will correctly return 56, but for a PBE-generated DES key, the security library bug causes it to return 64.

getType

public SymmetricKey.Type getType()