public class

PublicKeyFactory

extends Object
java.lang.Object
   ↳ org.bouncycastle.crypto.util.PublicKeyFactory

Class Overview

Factory to create asymmetric public key parameters for asymmetric ciphers from range of ASN.1 encoded SubjectPublicKeyInfo objects.

Summary

Public Constructors
PublicKeyFactory()
Public Methods
static AsymmetricKeyParameter createKey(byte[] keyInfoData)
Create a public key from a SubjectPublicKeyInfo encoding
static AsymmetricKeyParameter createKey(InputStream inStr)
Create a public key from a SubjectPublicKeyInfo encoding read from a stream
static AsymmetricKeyParameter createKey(SubjectPublicKeyInfo keyInfo)
Create a public key from the passed in SubjectPublicKeyInfo
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PublicKeyFactory ()

Public Methods

public static AsymmetricKeyParameter createKey (byte[] keyInfoData)

Create a public key from a SubjectPublicKeyInfo encoding

Parameters
keyInfoData the SubjectPublicKeyInfo encoding
Returns
  • the appropriate key parameter
Throws
IOException on an error decoding the key

public static AsymmetricKeyParameter createKey (InputStream inStr)

Create a public key from a SubjectPublicKeyInfo encoding read from a stream

Parameters
inStr the stream to read the SubjectPublicKeyInfo encoding from
Returns
  • the appropriate key parameter
Throws
IOException on an error decoding the key

public static AsymmetricKeyParameter createKey (SubjectPublicKeyInfo keyInfo)

Create a public key from the passed in SubjectPublicKeyInfo

Parameters
keyInfo the SubjectPublicKeyInfo containing the key data
Returns
  • the appropriate key parameter
Throws
IOException on an error decoding the key