|
SunSPOT host API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.security.signing.SigningService
public final class SigningService
The SigningService class is used to sign suites and other data on the desktop
using the SDK private key.
It also allows retrieving the public key from the keyfile.
Field Summary | |
---|---|
static String |
FORMAT_VERSION
|
Method Summary | |
---|---|
void |
generateKeyPair()
Generates a new SDK key pair and saves it into the keyfile specified in the constructor. |
byte[] |
getCertBytes()
The SDK public key is encoded as a self-signed X.509 certificate and the bytes corresponding to the certificate's DER encoding are returned. |
static SigningService |
getInstance()
Get the singleton instance of this class. |
byte[] |
getPublicKeyBytes()
Returns encoded SDK public key. |
boolean |
hasNoSDKKey()
To determine whether a private key was loaded. |
byte[] |
mkECCertBytes(String subjectCN,
ECPublicKey pub)
Creates an X.509 certificate for the given subject and key that is signed by the SDK's private key. |
static void |
setKeyDirectoryName(String keyDirectoryName)
Sets the directory where the key file (sdk.key) resides. |
byte[] |
sign(byte[] data)
Signs the input byte array (which might contain a suite or a command) with the SDK's private key and returns the DER-encoded ECDSA signature. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FORMAT_VERSION
Method Detail |
---|
public static void setKeyDirectoryName(String keyDirectoryName)
keyDirectoryName
- the directory where the keyfile is locatedpublic static SigningService getInstance() throws SigningServiceException
SigningServiceException
public byte[] sign(byte[] data) throws SigningServiceException
data
- to be signed
SigningServiceException
public byte[] getPublicKeyBytes() throws SigningServiceException
SigningServiceException
public byte[] getCertBytes() throws SigningServiceException
SigningServiceException
public void generateKeyPair() throws SigningServiceException
SigningServiceException
public boolean hasNoSDKKey()
public byte[] mkECCertBytes(String subjectCN, ECPublicKey pub) throws Exception
subjectCN
- String to be placed in the common name part of the
subject's distinguished namepub
- Public key associated with the subject
an
- Exception if there is a problem creating in the
certificate
Exception
|
SunSPOT host API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |