|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--CVCertificateStore
Class that abstracts a certificate and key store for a EAC PKI.
Defined in cvcertstore.js
Field Summary | |
Object |
path
|
Constructor Summary | |
CVCertificateStore(<String> path)
Create an object to access a certificate store. |
Method Summary | |
boolean
|
deleteCertificate(<String> path, <PublicKeyReference> chr, <boolean> selfsigned)
Remove certificate |
boolean
|
deletePrivateKey(<String> path, <PublicKeyReference> chr)
Remove private key |
boolean
|
deleteRequest(<String> path, <PublicKeyReference> chr)
Remove request |
CVC
|
getCertificate(<String> path, <PublicKeyReference> chr, <boolean> selfsigned)
Return certificate for a given CHR |
ByteString
|
getCertificateBinary(<String> path, <PublicKeyReference> chr, <boolean> selfsigned)
Return certificate for a given CHR in binary format |
CVC[]
|
getCertificateChain(<String> path, <PublicKeyReference> tochr, <PublicKeyReference> fromcar)
Return a chain of certificates resembling a path from root to end entity. |
CVC[]
|
getCertificateChainFor(<PublicKeyReference> cvcaref)
Returns a certificate chain for the current terminal certificate up to, but not including the the CVCA certificated referenced. |
PublicKeyReference
|
getCHRForSequenceNumber(<String> path, sequence, <String> countryseq)
Create a CHR for the given path and sequence number |
Crypto
|
getCrypto()
Return a suitable crypto object. |
PublicKeyReference
|
getCurrentCHR(<String> path)
Return the current CHR for which a valid certificate exists |
CVC
|
getCVCACertificateFor(<PublicKeyReference> cvcaref)
Returns the country verifying certification authority's certificate for a given CVCA reference. |
XML
|
getDefaultConfig()
Create a default configuration |
Key
|
getDefaultDomainParameter(<String> path)
Returns the default domain parameter for a given PKI |
ByteString
|
getDefaultPublicKeyOID(<String> path)
Returns the default algorithm identifier OID from the most recent link certificate |
Key
|
getDomainParameter(<String> path, <PublicKeyReference> chr)
Returns the domain parameter for a certificate identified by its CHR |
CVC
|
getDVCACertificateFor(<PublicKeyReference> cvcaref, <PublicKeyReference> dvcaref)
Returns the document verifier certificate for a given CVCA and DV reference. |
PublicKeyReference
|
getNextCHR(<String> path, <String> countryseq)
Return the next CHR |
Key
|
getPrivateKey(<String> path, <PublicKeyReference> chr)
Get a private key in the certificate store |
CVC
|
getRequest(<String> path, <PublicKeyReference> chr)
Return request for given CHR |
CVC
|
getTerminalCertificateFor(<PublicKeyReference> cvcaref)
Returns the current terminal certificate for a given CVCA reference. |
Key
|
getTerminalKeyFor(<PublicKeyReference> cvcaref)
Return the current terminal key for a PKI identified by the CVCA reference |
boolean
|
insertCertificate(<Crypto> crypto, <CVC> cvc, <String> cvcahint)
Insert a single certificates into the certificate store |
CVC[]
|
insertCertificates(<Crypto> crypto, <CVC[]> certlist, <Boolean> insertSelfSigned)
Insert certificates into certificate store |
CVC[]
|
insertCertificates2(<Crypto> crypto, <CVC[]> certlist, <Boolean> insertSelfSigned, <String> cvcahint)
Insert certificates into certificate store |
CVC[]
|
listCertificates(<String> path)
List certificates stored for given PKI element sorted by CHR |
String[]
|
listHolders(<String> path)
List certificate holders for a given PKI element |
XML
|
loadConfig(<String> path)
Load configuration |
String
|
mapPath(<String> path)
Map to absolute path on file system |
void
|
saveConfig(<String> path, <XML> cfg)
Save configuration |
void
|
storeCertificate(<String> path, <CVC> cert, <Boolean> makeCurrent)
Store a certificate in the certificate store |
void
|
storePrivateKey(<String> path, <PublicKeyReference> chr, <Key> prk)
Store a private key in the certificate store |
void
|
storeRequest(<String> path, <CVC> req)
Store a certificate request in the certificate store |
<static> void
|
checkPath(path)
Check path for legal encodings |
<static> String
|
encodeBase36(<Number> value)
Encode a three character alpha-numeric sequence number |
<static> ByteString
|
loadBinaryFile(<String> filename)
Loads a binary file from disk |
<static> XML
|
loadXMLFile(<String> filename)
Loads a XML file from disk |
<static> String
|
nthElementOf(<String> path, n)
Return the n-element of the path |
<static> String
|
parentPathOf(<String> path)
Strip the last element of the path, effectively defining the parent within the path |
<static> void
|
saveBinaryFile(<String> filename, <ByteString> data)
Saves a binary file to disk |
<static> void
|
saveXMLFile(<String> filename, xml)
Saves XML to disk |
Field Detail |
Object path
Constructor Detail |
CVCertificateStore(<String> path)
path
- the root of the certificate store
Method Detail |
boolean deleteCertificate(<String> path, <PublicKeyReference> chr, <boolean> selfsigned)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for this certificate
selfsigned
- delete the self-signed root certificate rather than a link certificate
boolean deletePrivateKey(<String> path, <PublicKeyReference> chr)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for this key
boolean deleteRequest(<String> path, <PublicKeyReference> chr)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for this request
CVC getCertificate(<String> path, <PublicKeyReference> chr, <boolean> selfsigned)
This method returns a self-signed root certificate if the selfsigned parameter is set. If not set or set to false, then matching link certificate, if any, is returned rather than the self-signed certificate.
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for the certificate
selfsigned
- return the self-signed root certificate rather than a link certificate
ByteString getCertificateBinary(<String> path, <PublicKeyReference> chr, <boolean> selfsigned)
This method returns a self-signed root certificate if the selfsigned parameter is set. If not set or set to false, then matching link certificate, if any, is returned rather than the self-signed certificate.
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for the certificate
selfsigned
- return the self-signed root certificate rather than a link certificate
CVC[] getCertificateChain(<String> path, <PublicKeyReference> tochr, <PublicKeyReference> fromcar)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
tochr
- the public key reference for the certificate at the end of the chain
fromcar
- the public key reference for the certificate to start with or root if undefined
CVC[] getCertificateChainFor(<PublicKeyReference> cvcaref)
cvcaref
- the public key reference (CHR) of the CVCA.
PublicKeyReference getCHRForSequenceNumber(<String> path, sequence, <String> countryseq)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1")
countryseq
- the 2 digit country code to include in the sequence number (optional)
the
- sequence number to be translated
Crypto getCrypto()
PublicKeyReference getCurrentCHR(<String> path)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1")
CVC getCVCACertificateFor(<PublicKeyReference> cvcaref)
cvcaref
- the public key reference (CHR) of the CVCA.
dvcaref
- the public key reference (CHR) of the DV.
XML getDefaultConfig()
Key getDefaultDomainParameter(<String> path)
path
- the PKI path (e.g. "/UTCVCA1/UTDVCA1/UTTERM"). Only the first path element is relevant
ByteString getDefaultPublicKeyOID(<String> path)
path
- the PKI path (e.g. "/UTCVCA1/UTDVCA1/UTTERM"). Only the first path element is relevant
Key getDomainParameter(<String> path, <PublicKeyReference> chr)
This method traverses the certificate hierachie upwards and follows link certificates until domain parameter are found.
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1")
chr
- the CHR of the certificate to start the search with
CVC getDVCACertificateFor(<PublicKeyReference> cvcaref, <PublicKeyReference> dvcaref)
cvcaref
- the public key reference (CHR) of the CVCA.
dvcaref
- the public key reference (CHR) of the DV.
PublicKeyReference getNextCHR(<String> path, <String> countryseq)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1")
countryseq
- the 2 digit country code to include in the sequence number (optional)
Key getPrivateKey(<String> path, <PublicKeyReference> chr)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for this key
CVC getRequest(<String> path, <PublicKeyReference> chr)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for the certificate
CVC getTerminalCertificateFor(<PublicKeyReference> cvcaref)
cvcaref
- the public key reference (CHR) of the root CA.
Key getTerminalKeyFor(<PublicKeyReference> cvcaref)
cvcaref
- the public key reference (CHR) of the CVCA.
boolean insertCertificate(<Crypto> crypto, <CVC> cvc, <String> cvcahint)
Before a certificate is imported, the signature is verified.
If the certificate is a terminal certificate, then the first element of the path given in cvcahint is used to determine the correct CVCA.
crypto
- the crypto provider to be used for certificate verification
cvc
- the certificate
cvcahint
- the PKI path (e.g. "/UTCVCA1/UTDVCA1/UTTERM"). Only the first path element is relevant
CVC[] insertCertificates(<Crypto> crypto, <CVC[]> certlist, <Boolean> insertSelfSigned)
The import into the internal data structure is done in three steps:
Certificates at the terminal level can only be imported, if the issuing DVCA certificate is contained in the list. Even if a DVCA certificate is already stored, the import of such a certificate will be skipped if the DVCA certificate is not part of the imported list.
Before a certificate is imported, the signature is verified.
crypto
- the crypto provider to be used for certificate verification
certlist
- the unordered list of certificates
insertSelfSigned
- true, if the import of root certificates is allowed
CVC[] insertCertificates2(<Crypto> crypto, <CVC[]> certlist, <Boolean> insertSelfSigned, <String> cvcahint)
The import into the internal data structure is done in three steps:
Certificates at the terminal level can only be imported, if the issuing DVCA certificate is contained in the list or a hint for the relevant CVCA is given in the first element of the path contained in parameter cvcahint.
Before a certificate is imported, the signature is verified.
crypto
- the crypto provider to be used for certificate verification
certlist
- the unordered list of certificates
insertSelfSigned
- true, if the import of root certificates is allowed
cvcahint
- the PKI path (e.g. "/UTCVCA1/UTDVCA1/UTTERM"). Only the first path element is relevant
CVC[] listCertificates(<String> path)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
String[] listHolders(<String> path)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1")
XML loadConfig(<String> path)
path
- the relative path of the PKI element (e.g. "UTCVCA1/UTDVCA1")
String mapPath(<String> path)
path
- the relative path
void saveConfig(<String> path, <XML> cfg)
This method will create the necessary path and save the configuration to config.xml
path
- the relative path of the PKI element (e.g. "UTCVCA1/UTDVCA1")
cfg
- the configuration object
void storeCertificate(<String> path, <CVC> cert, <Boolean> makeCurrent)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
cert
- the certificate
makeCurrent
- true if this certificate become the current certificate
void storePrivateKey(<String> path, <PublicKeyReference> chr, <Key> prk)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
chr
- the public key reference for this key
prk
- the private key
void storeRequest(<String> path, <CVC> req)
path
- the relative path of the PKI element (e.g. "/UTCVCA1/UTDVCA1/UTTERM")
req
- the request
<static> void checkPath(path)
<static> String encodeBase36(<Number> value)
This function encodes values in the range 0 to 999 as numeric string with leading zeros.
Value in the range 1000 to 34695 (999 + 26 * 36 * 36) are encoded as alphanumeric string.
Value beyond 34696 are truncated
value
- integer sequence value
<static> ByteString loadBinaryFile(<String> filename)
filename
- the fully qualified file name
<static> XML loadXMLFile(<String> filename)
filename
- the fully qualified file name
<static> String nthElementOf(<String> path, n)
path
- the path to return the last element from
<static> String parentPathOf(<String> path)
path
- the path to strip the last element from
<static> void saveBinaryFile(<String> filename, <ByteString> data)
filename
- the fully qualified file name
data
- the binary content
<static> void saveXMLFile(<String> filename, xml)
filename
- the fully qualified file name
data
- the XML content
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |