net.named_data.jndn.security.identity
public class MemoryIdentityStorage extends IdentityStorage
Constructor and Description |
---|
MemoryIdentityStorage() |
Modifier and Type | Method and Description |
---|---|
void |
activateKey(Name keyName)
Activate a key.
|
void |
addCertificate(IdentityCertificate certificate)
Add a certificate to the identity storage.
|
void |
addIdentity(Name identityName)
Add a new identity.
|
void |
addKey(Name keyName,
KeyType keyType,
Blob publicKeyDer)
Add a public key to the identity storage.
|
void |
deactivateKey(Name keyName)
Deactivate a key.
|
void |
deleteCertificateInfo(Name certificateName)
Delete a certificate.
|
void |
deleteIdentityInfo(Name identity)
Delete an identity and related public keys and certificates.
|
void |
deletePublicKeyInfo(Name keyName)
Delete a public key and related certificates.
|
boolean |
doesCertificateExist(Name certificateName)
Check if the specified certificate already exists.
|
boolean |
doesIdentityExist(Name identityName)
Check if the specified identity already exists.
|
boolean |
doesKeyExist(Name keyName)
Check if the specified key already exists.
|
void |
getAllCertificateNamesOfKey(Name keyName,
ArrayList nameList,
boolean isDefault)
Append all the certificate names of a particular key name to the nameList.
|
void |
getAllIdentities(ArrayList nameList,
boolean isDefault)
Append all the identity names to the nameList.
|
void |
getAllKeyNamesOfIdentity(Name identityName,
ArrayList nameList,
boolean isDefault)
Append all the key names of a particular identity to the nameList.
|
IdentityCertificate |
getCertificate(Name certificateName)
Get a certificate from the identity storage.
|
Name |
getDefaultCertificateNameForKey(Name keyName)
Get the default certificate name for the specified key.
|
Name |
getDefaultIdentity()
Get the default identity.
|
Name |
getDefaultKeyNameForIdentity(Name identityName)
Get the default key name for the specified identity.
|
Blob |
getKey(Name keyName)
Get the public key DER blob from the identity storage.
|
boolean |
revokeIdentity()
Revoke the identity.
|
void |
setDefaultCertificateNameForKey(Name keyName,
Name certificateName)
Set the default key name for the specified identity.
|
void |
setDefaultIdentity(Name identityName)
Set the default identity.
|
void |
setDefaultKeyNameForIdentity(Name keyName,
Name identityNameCheck)
Set a key as the default key of an identity.
|
getDefaultCertificate, getDefaultCertificateNameForIdentity, getNewKeyName, setDefaultKeyNameForIdentity
public boolean doesIdentityExist(Name identityName)
doesIdentityExist
in class IdentityStorage
identityName
- The identity name.public void addIdentity(Name identityName) throws SecurityException
addIdentity
in class IdentityStorage
identityName
- The identity name to be added.SecurityException
public boolean revokeIdentity()
revokeIdentity
in class IdentityStorage
public boolean doesKeyExist(Name keyName) throws SecurityException
doesKeyExist
in class IdentityStorage
keyName
- The name of the key.SecurityException
public void addKey(Name keyName, KeyType keyType, Blob publicKeyDer) throws SecurityException
addKey
in class IdentityStorage
keyName
- The name of the public key to be added.keyType
- Type of the public key to be added.publicKeyDer
- A blob of the public key DER to be added.SecurityException
public Blob getKey(Name keyName) throws SecurityException
getKey
in class IdentityStorage
keyName
- The name of the requested public key.SecurityException
- if the key doesn't exist.public void activateKey(Name keyName)
activateKey
in class IdentityStorage
keyName
- The name of the key.public void deactivateKey(Name keyName)
deactivateKey
in class IdentityStorage
keyName
- The name of the key.public boolean doesCertificateExist(Name certificateName)
doesCertificateExist
in class IdentityStorage
certificateName
- The name of the certificate.public void addCertificate(IdentityCertificate certificate) throws SecurityException
addCertificate
in class IdentityStorage
certificate
- The certificate to be added. This makes a copy of the
certificate.SecurityException
public IdentityCertificate getCertificate(Name certificateName) throws SecurityException
getCertificate
in class IdentityStorage
certificateName
- The name of the requested certificate.SecurityException
- if the certificate doesn't exist.public Name getDefaultIdentity() throws SecurityException
getDefaultIdentity
in class IdentityStorage
SecurityException
- if the default identity is not set.public Name getDefaultKeyNameForIdentity(Name identityName) throws SecurityException
getDefaultKeyNameForIdentity
in class IdentityStorage
identityName
- The identity name.SecurityException
- if the default key name for the identity is not set.public Name getDefaultCertificateNameForKey(Name keyName) throws SecurityException
getDefaultCertificateNameForKey
in class IdentityStorage
keyName
- The key name.SecurityException
- if the default certificate name for the key name
is not set.public void getAllIdentities(ArrayList nameList, boolean isDefault)
getAllIdentities
in class IdentityStorage
nameList
- Append result names to nameList.isDefault
- If true, add only the default identity name. If false, add
only the non-default identity names.public void getAllKeyNamesOfIdentity(Name identityName, ArrayList nameList, boolean isDefault)
getAllKeyNamesOfIdentity
in class IdentityStorage
identityName
- The identity name to search for.nameList
- Append result names to nameList.isDefault
- If true, add only the default key name. If false, add only
the non-default key names.public void getAllCertificateNamesOfKey(Name keyName, ArrayList nameList, boolean isDefault) throws SecurityException
getAllCertificateNamesOfKey
in class IdentityStorage
keyName
- The key name to search for.nameList
- Append result names to nameList.isDefault
- If true, add only the default certificate name. If false,
add only the non-default certificate names.SecurityException
public void setDefaultIdentity(Name identityName)
setDefaultIdentity
in class IdentityStorage
identityName
- The default identity name.public void setDefaultKeyNameForIdentity(Name keyName, Name identityNameCheck) throws SecurityException
setDefaultKeyNameForIdentity
in class IdentityStorage
keyName
- The name of the key.identityNameCheck
- The identity name to check that the keyName
contains the same identity name. If an empty name, it is ignored.SecurityException
public void setDefaultCertificateNameForKey(Name keyName, Name certificateName)
setDefaultCertificateNameForKey
in class IdentityStorage
keyName
- The key name.certificateName
- The certificate name.public void deleteCertificateInfo(Name certificateName) throws SecurityException
deleteCertificateInfo
in class IdentityStorage
certificateName
- The certificate name.SecurityException
public void deletePublicKeyInfo(Name keyName) throws SecurityException
deletePublicKeyInfo
in class IdentityStorage
keyName
- The key name.SecurityException
public void deleteIdentityInfo(Name identity) throws SecurityException
deleteIdentityInfo
in class IdentityStorage
identity
- The identity name.SecurityException
Copyright © 2016. All rights reserved.