Class EncodedKeySpec

java.lang.Object
java.security.spec.EncodedKeySpec
All Implemented Interfaces:
KeySpec
Direct Known Subclasses:
PKCS8EncodedKeySpec, X509EncodedKeySpec

public abstract class EncodedKeySpec
extends Object
implements KeySpec
The abstract key specification for a public or a private key in encoded format.
  • Constructor Details

    • EncodedKeySpec

      public EncodedKeySpec​(byte[] encodedKey)
      Creates a new EncodedKeySpec with the specified encoded key bytes.
      Parameters:
      encodedKey - the encoded key bytes.
  • Method Details

    • getEncoded

      public byte[] getEncoded()
      Returns the encoded key bytes.
      Returns:
      the encoded key bytes.
    • getFormat

      public abstract String getFormat()
      Returns the name of the encoding format of this encoded key specification.
      Returns:
      the name of the encoding format of this encoded key specification.