Package org.conscrypt

Class KeySpecUtil


  • public final class KeySpecUtil
    extends java.lang.Object
    A utility class for working with KeySpecs.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private KeySpecUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends java.security.spec.KeySpec>
      T
      makeRawKeySpec​(byte[] bytes, java.lang.Class<T> keySpecClass)
      Creates a KeySpec object for the provided keySpecClass.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeySpecUtil

        private KeySpecUtil()
    • Method Detail

      • makeRawKeySpec

        public static <T extends java.security.spec.KeySpec> T makeRawKeySpec​(byte[] bytes,
                                                                              java.lang.Class<T> keySpecClass)
                                                                       throws java.security.spec.InvalidKeySpecException
        Creates a KeySpec object for the provided keySpecClass. The KeySpec must be a subclass of EncodedKeySpec and its getFormat() method must return "raw".
        Throws:
        java.security.spec.InvalidKeySpecException