Type.PUBLIC/"X.509" - gets a KeyFactory instance for
the key algorithm, constructs an X509EncodedKeySpec with the
encoded key bytes, and generates a public key from the spec

Type.PRIVATE/"PKCS#8" - gets a KeyFactory instance for
the key algorithm, constructs a PKCS8EncodedKeySpec with the
encoded key bytes, and generates a private key from the spec

Returns:

the resolved Key object

Throws:

NotSerializableException - if the Type/format
combination is unrecognized, if the algorithm, key format, or
encoded key bytes are unrecognized/invalid, of if the
resolution of the key fails for any reason