public class PKCS15Provider extends Provider
Modifier and Type | Class and Description |
---|---|
class |
PKCS15Provider.Path
This class represents a Path object as defined in chapter 6.1.5 of the
PKCS#15 specification (v1.1).
|
Modifier and Type | Field and Description |
---|---|
static byte[] |
AID_PKCS15
Default PKCS#15 AID.
|
Constructor and Description |
---|
PKCS15Provider(Channel channel)
Encapsulates the defined channel by a PKCS#15 file system object.
|
Modifier and Type | Method and Description |
---|---|
PKCS15Provider.Path |
decodePath(byte[] der)
Builds a Path object using a DER-encoded (see ITU X.690 for DER-Coding)
buffer.
|
PKCS15Provider.Path[] |
getAuthObjPaths()
Returns an array of EF(AODF) paths (Authentication Object Directory
Files).
|
PKCS15Provider.Path[] |
getCertificatePaths()
Returns an array of EF(CDF) paths (Certificate Directory Files).
|
PKCS15Provider.Path[] |
getDataObjPaths()
Returns an array of EF(DODF) paths (Data Object Directory Files).
|
byte[] |
getODF()
Returns the raw content of the EF(ODF) (Object Directory File).
|
PKCS15Provider.Path[] |
getPrivateKeyPaths()
Returns an array of EF(PrKDF) paths (Private Key Directory Files).
|
PKCS15Provider.Path[] |
getPublicKeyPaths()
Returns an array of EF(PuKDF) paths (Public Key Directory Files).
|
byte[] |
getTokenInfo()
Returns the raw content of the EF(TokenInfo).
|
byte[] |
readFile(PKCS15Provider.Path path)
Selects and reads a PKCS#15 file.
|
byte[] |
searchOID(byte[] dodf,
java.lang.String oid)
Parses the raw content of an EF(DODF) and searches for a specific OID
Data Object.
|
getChannel
public PKCS15Provider(Channel channel) throws java.io.IOException, java.lang.IllegalStateException
channel
- The channel that shall be used by this Provider for file
operations.java.io.IOException
- if no PKCS#15 file system is detected on the provided
channel.java.lang.IllegalStateException
- if the defined channel is closed.public byte[] getODF() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the defined channel is closed.public byte[] getTokenInfo()
public PKCS15Provider.Path[] getPrivateKeyPaths()
public PKCS15Provider.Path[] getPublicKeyPaths()
public PKCS15Provider.Path[] getCertificatePaths()
public PKCS15Provider.Path[] getDataObjPaths()
public PKCS15Provider.Path[] getAuthObjPaths()
public byte[] readFile(PKCS15Provider.Path path) throws java.lang.SecurityException, java.lang.UnsupportedOperationException, java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException
path
- Path of the file.java.lang.UnsupportedOperationException
- if this operation is not supported.java.lang.SecurityException
- if the operation cannot be performed if a
security condition is not satisfied.java.lang.IllegalArgumentException
- if the PKCS#15 file cannot be selected
or read. TODO: should be an IllegalReferenceErrorjava.io.IOException
- Lower-lever API exception.java.lang.IllegalStateException
- if the used channel is closed.public byte[] searchOID(byte[] dodf, java.lang.String oid) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
dodf
- The raw content of an EF(DODF) to parse.oid
- The searched OID value (e.g. OMA-DM bootstrap OID is
2.23.43.7.1).java.lang.IllegalArgumentException
- if the OID is not correct.java.lang.UnsupportedOperationException
- if this operation is not supported.public PKCS15Provider.Path decodePath(byte[] der) throws java.lang.IllegalArgumentException
der
- the DER-encoded Path object as a byte array.java.lang.IllegalArgumentException
- if the defined path is not a correctly
DER-encoded buffer.SEEK for Android Copyright 2015, Giesecke & Devrient GmbH