APIdia Launch Partner
Top Description Methods
sun.security.util

public Interface SliceableSecretKey

Imports
javax.crypto.SecretKey

An interface for SecretKeys that support using its slice as a new SecretKey.

This is mainly used by PKCS #11 implementations that support the EXTRACT_KEY_FROM_KEY mechanism even if the key itself is sensitive and non-extractable.

Method Summary

Modifier and TypeMethod and Description
public SecretKey

Returns:

the new key
slice
(String
the new algorithm name
alg
,
int
the byte offset of the new key in the full key
from
,
int
the to offset (exclusive) of the new key in the full key
to
)

Returns a slice as a new SecretKey.

Method Detail

sliceback to summary
public SecretKey slice(String alg, int from, int to)

Returns a slice as a new SecretKey.

Parameters
alg:String

the new algorithm name

from:int

the byte offset of the new key in the full key

to:int

the to offset (exclusive) of the new key in the full key

Returns:SecretKey

the new key

Exceptions
ArrayIndexOutOfBoundsException:
for improper from and to values
UnsupportedOperationException:
if slicing is not supported