|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--spki.demo.KeyChain
spki.demo KeyChain class.
| Field Summary | |
private static String |
__ME
This class's full name. |
private HashDB |
authchain_db
the authorization-chain database object. |
(package private) static String |
AUTHCHAIN_DBNAME
the authorization-chain database filename suffix. |
private static String |
CERT_DBNAME
the live master certificates database filename suffix. |
private static int |
CERT_INDEX
the position of the master certificate in each element of the place-holder database. |
static String |
CERTIFICATION_TAG_STRING
|
private PublicKey |
certifier
the key-chain certifier's public key. |
private static String |
CERTIFIER_KEY_DBKEY
the certifier public key's database index key. |
private String |
db_id
|
static String |
DBPATH
databases's pathname prefix. |
static int |
DEFAULT_KEY_LENGTH
|
static String |
DEFAULT_PUB_ALG
|
private HashDB |
holder_db
the place-holder database object. |
private static String |
HOLDER_DBNAME
the place-holder database filename suffix. |
private HashDB |
issuer_db
the issuers' public keys database object. |
private static String |
ISSUER_DBNAME
the issuers' public keys database filename suffix. |
private int |
key_length
the key-chain default key-length in bits. |
private static String |
KEY_LENGTH_DBKEY
the key-length's database index key. |
private HashDB |
keypool_db
the key-pool database object. |
private static String |
KEYPOOL_DBNAME
the key-pool database filename suffix. |
private HashDB |
main_db
the main database object. |
private static String |
MAIN_DBNAME
the main database filename suffix. |
private Certificate |
master_cert
the key-chain master key-pair's certificate. |
private static String |
MASTER_CERT_DBKEY
the master certificate's database index key. |
private String |
master_keyid
the key-chain master key-pair's key-id. |
private static String |
MASTER_KEYPAIR_DBKEY
the master key-pair's database index key. |
private PrivateKey |
master_privkey
the key-chain master key-pair's private key. |
private PublicKey |
master_pubkey
the key-chain master key-pair's public key. |
private HashDB |
mastercert_db
the live master certificates database object. |
static int |
MINIMUM_CODELENGTH
|
static int |
MINIMUM_POOLSIZE
|
private String |
passcode
the key-chain access-control passcode. |
private static char[] |
PASSCODE_ALPHABET
the alphabet of valid digits for the initial random passcode, which simply consists of lower-case hexadecial digits (0-9 and a-f). |
private static String |
PASSCODE_DBKEY
the passcode's database index key. |
private HashDB |
privkey_db
the live private-keys database object. |
private static String |
PRIVKEY_DBNAME
the live private-keys database filename suffix. |
private static int |
PRIVKEY_INDEX
the position of the private key in each element of the keypool and place-holder database. |
private String |
pub_alg
the key-chain's public-key algorithm-id. |
private static String |
PUB_ALG_DBKEY
the public-key algorithm-id's database index key. |
private HashDB |
pubkey_db
the live public-keys database object. |
private static String |
PUBKEY_DBNAME
the live public-keys database filename suffix. |
private static int |
PUBKEY_INDEX
the position of the public key in each element of the keypool and place-holder database. |
private int |
state
|
static int |
STATE_ALIVE
|
static int |
STATE_DEAD
|
static int |
STATE_INITIALIZED
|
static int |
STATE_PERSONALIZED
|
static int |
STATE_REGISTERED
|
static String[] |
STATES
|
| Constructor Summary | |
KeyChain()
Create a brand new key-chain, using the default algorithm and key-length. |
|
KeyChain(String db_id)
Restore a live key-chain with the specified database id. |
|
KeyChain(String pub_alg,
int key_length)
Create a brand new key-chain, using the specified algorithm and key-length. |
|
| Method Summary | |
private void |
activateKeyPair(String passcode,
String keyid)
activate the key-pair specified by the given key-id. |
void |
addAuthChain(String passcode,
Sequence chain)
add a new authorization chain to the key-chain's database, add the root issuer to the issuer list if neccessary, and activate the associated subject principal. |
private void |
addIssuer(String passcode,
PublicKey issuer)
store a new issuer's public key in the issuer database. |
(package private) boolean |
authenticate(String passcode)
verify the given passcode. |
private String |
buildDBname(String dbname)
|
void |
changePassCode(String oldcode,
String newcode)
change the passcode to the given one. |
private void |
closeDB()
to be used by the finalize() method only! |
private void |
construct()
|
private void |
deactivateKeyPair(String passcode,
String keyid)
deactivate (read: permanently purge the private key) the key-pair specified by the given key-id. |
private PrivateKey |
fetchActivePrivateKey(String keyid)
search a private key with the given key-id from the active private key database. |
private PublicKey |
fetchActivePublicKey(String keyid)
search a public key with the given key-id from the active private key database. |
Sequence |
fetchNewKeyPair(String passcode)
get a fresh key-pair from the key-pool. |
protected void |
finalize()
|
Sequence |
getAuthChain(String passcode,
String chainid)
search and return an authorization chain with the given chain-id. |
Principal |
getCertifier()
get the certifier's principal. |
String |
getDBId()
get this key-chain's database id. |
int |
getKeyPoolSize(String passcode)
get the current key-pool size. |
Certificate |
getMasterCert()
get the master-key's certificate. |
PublicKey |
getMasterKey()
get this key-chain's master public-key. |
Certificate |
getNewPrincipal(String passcode)
get a fresh unused principal. |
int |
getState()
get the current state. |
String |
initialize(PublicKey certifier,
Certificate cert)
initialize this key-chain with the given cretifier and certificate. |
private void |
openDB()
to be used by construct() and restore() only! |
void |
personalize(String oldcode,
String newcode,
int poolsize)
personalize this key-chain with the given new passcode and initial key-pool size. |
void |
refreshKeyPool(String passcode,
int poolsize)
create/refresh the key-pool to the given pool-size or MINIMUM_POOLSIZE constant, whichever is bigger. |
RegistrationRequest |
register(String passcode,
PublicKey issuer,
Sexp nonce,
Tag capability)
create a registration request with the given issuer's public-key, registration nonce, and capability. |
AuthorizationRequest |
request(String passcode,
Principal monitor,
String chainid,
Sexp nonce,
Principal issuer,
Tag capability)
create an authorization request for the given monitor's princpal, authorization chain-id, request nonce, issuer's principal, and capability. |
void |
restore(String db_id)
|
Certificate |
transfer(String passcode,
String keyid,
RegistrationRequest request)
transfer a capability from a principal of this key-chain to another principal according to the request and purge the issuing private key. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final String __ME
public static final String DBPATH
private static final String MAIN_DBNAME
private HashDB main_db
private static final String KEYPOOL_DBNAME
private HashDB keypool_db
public static final int MINIMUM_POOLSIZE
private static final String HOLDER_DBNAME
private HashDB holder_db
private static final String PRIVKEY_DBNAME
private HashDB privkey_db
private static final String PUBKEY_DBNAME
private HashDB pubkey_db
private static final String CERT_DBNAME
private HashDB mastercert_db
private static final String ISSUER_DBNAME
private HashDB issuer_db
static final String AUTHCHAIN_DBNAME
private HashDB authchain_db
private String db_id
private static final int PRIVKEY_INDEX
private static final int PUBKEY_INDEX
private static final int CERT_INDEX
private static final String MASTER_KEYPAIR_DBKEY
private static final String PASSCODE_DBKEY
private static final String CERTIFIER_KEY_DBKEY
private static final String MASTER_CERT_DBKEY
private static final String PUB_ALG_DBKEY
private static final String KEY_LENGTH_DBKEY
private PublicKey certifier
private PublicKey master_pubkey
private PrivateKey master_privkey
private String master_keyid
private Certificate master_cert
public static final String DEFAULT_PUB_ALG
private String pub_alg
public static final int DEFAULT_KEY_LENGTH
private int key_length
public static final int STATE_DEAD
public static final int STATE_ALIVE
public static final int STATE_INITIALIZED
public static final int STATE_PERSONALIZED
public static final int STATE_REGISTERED
private int state
public static final String[] STATES
private String passcode
public static final int MINIMUM_CODELENGTH
private static final char[] PASSCODE_ALPHABET
public static final String CERTIFICATION_TAG_STRING
| Constructor Detail |
public KeyChain()
throws SPKIException
KeyChain(String,int)
public KeyChain(String pub_alg,
int key_length)
throws SPKIException
KeyChain()
public KeyChain(String db_id)
throws SPKIException
KeyChain(),
KeyChain(String,int)| Method Detail |
protected void finalize()
public int getState()
public String getDBId()
public PublicKey getMasterKey()
public String initialize(PublicKey certifier,
Certificate cert)
throws SPKIException
public Principal getCertifier()
public Certificate getMasterCert()
public void personalize(String oldcode,
String newcode,
int poolsize)
throws SPKIException
public void changePassCode(String oldcode,
String newcode)
throws SPKIException
public void refreshKeyPool(String passcode,
int poolsize)
throws SPKIException
public int getKeyPoolSize(String passcode)
throws SPKIException
public RegistrationRequest register(String passcode,
PublicKey issuer,
Sexp nonce,
Tag capability)
throws SPKIException
public Sequence getAuthChain(String passcode,
String chainid)
throws SPKIException
public void addAuthChain(String passcode,
Sequence chain)
throws SPKIException
public Certificate getNewPrincipal(String passcode)
throws SPKIException
public Certificate transfer(String passcode,
String keyid,
RegistrationRequest request)
throws SPKIException
public AuthorizationRequest request(String passcode,
Principal monitor,
String chainid,
Sexp nonce,
Principal issuer,
Tag capability)
throws SPKIException
boolean authenticate(String passcode)
private PrivateKey fetchActivePrivateKey(String keyid)
throws SPKIException
private PublicKey fetchActivePublicKey(String keyid)
throws SPKIException
private void openDB()
throws SPKIException
private void closeDB()
throws SPKIException
private String buildDBname(String dbname)
throws SPKIException
private void construct()
throws Exception
public void restore(String db_id)
throws Exception
public Sequence fetchNewKeyPair(String passcode)
throws SPKIException
private void activateKeyPair(String passcode,
String keyid)
throws SPKIException
private void deactivateKeyPair(String passcode,
String keyid)
throws SPKIException
private void addIssuer(String passcode,
PublicKey issuer)
throws SPKIException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||