Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.4
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mozilla.jss.pkcs11
Class PK11SymKey

    java.lang.Object
      |
      +--org.mozilla.jss.pkcs11.PK11SymKey

All Implemented Interfaces:
  SymmetricKey

public final class PK11SymKey
extends java.lang.Object
implements SymmetricKey

Nested Class Summary

Nested classes inherited from class org.mozilla.jss.crypto.SymmetricKey
`SymmetricKey.NotExtractableException, SymmetricKey.Type, SymmetricKey.Usage`

Field Summary

Fields inherited from interface org.mozilla.jss.crypto.SymmetricKey
`DES, DES3, RC2, RC4, SHA1_HMAC`

Constructor Summary
`protected` | `PK11SymKey(byte[] pointer)`

Method Summary
`java.lang.String` | `getAlgorithm()`
`byte[]` | `getEncoded()`
`java.lang.String` | `getFormat()`
`byte[]` | `getKeyData()`
`org.mozilla.jss.pkcs11.KeyType` | `getKeyType()`
`int` | `getLength()` Returns the length of the key in bytes, as returned by PK11_GetKeyLength().
`CryptoToken` | `getOwningToken()`
`int` | `getStrength()` Returns key strength, measured as the number of bits of secret material.
`SymmetricKey.Type` | `getType()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PK11SymKey

    protected PK11SymKey(byte[] pointer)

Method Detail

### getType

    public SymmetricKey.Type getType()

  Specified by:
    `getType` in interface `SymmetricKey`

### getOwningToken

    public CryptoToken getOwningToken()

  Specified by:
    `getOwningToken` in interface `SymmetricKey`

### 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.

  Specified by:
    `getStrength` in interface `SymmetricKey`

### getLength

    public int getLength()

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

  Specified by:
    `getLength` in interface `SymmetricKey`

### getKeyData

    public byte[] getKeyData()
                      throws SymmetricKey.NotExtractableException

  Specified by:
    `getKeyData` in interface `SymmetricKey`
    `SymmetricKey.NotExtractableException`

### getKeyType

    public org.mozilla.jss.pkcs11.KeyType getKeyType()

### getAlgorithm

    public java.lang.String getAlgorithm()

  Specified by:
    `getAlgorithm` in interface `SymmetricKey`

### getEncoded

    public byte[] getEncoded()

  Specified by:
    `getEncoded` in interface `SymmetricKey`

### getFormat

    public java.lang.String getFormat()

  Specified by:
    `getFormat` in interface `SymmetricKey`

Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.4
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD