SecPublicInfo is a base class for the storage of public information. More...
#include <sec-public-info.hpp>
Classes | |
class | Error |
Public Member Functions | |
SecPublicInfo (const std::string &location) | |
virtual | ~SecPublicInfo () |
The virtual Destructor. More... | |
virtual void | addCertificate (const IdentityCertificate &certificate)=0 |
Add a certificate to the identity storage. More... | |
void | addCertificateAsIdentityDefault (const IdentityCertificate &certificate) |
Add a certificate into the public key identity storage and set the certificate as the default one of its corresponding identity. More... | |
void | addCertificateAsKeyDefault (const IdentityCertificate &certificate) |
Add a certificate and set the certificate as the default one of its corresponding key. More... | |
void | addCertificateAsSystemDefault (const IdentityCertificate &certificate) |
Add a certificate into the public key identity storage and set the certificate as the default one of the default identity. More... | |
virtual void | addIdentity (const Name &identityName)=0 |
Add a new identity. More... | |
virtual void | addKey (const Name &keyName, const PublicKey &publicKey)=0 |
Add a public key to the identity storage. More... | |
void | addPublicKey (const Name &keyName, KeyType keyType, const PublicKey &publicKey) |
Add a public key to the identity storage. More... | |
shared_ptr< IdentityCertificate > | defaultCertificate () |
Get cached default certificate of the default identity. More... | |
virtual void | deleteCertificateInfo (const Name &certificateName)=0 |
Delete a certificate. More... | |
virtual void | deleteIdentityInfo (const Name &identity)=0 |
Delete an identity and related public keys and certificates. More... | |
virtual void | deletePublicKeyInfo (const Name &keyName)=0 |
Delete a public key and related certificates. More... | |
virtual bool | doesCertificateExist (const Name &certificateName)=0 |
Check if the specified certificate already exists. More... | |
virtual bool | doesIdentityExist (const Name &identityName)=0 |
Check if the specified identity already exists. More... | |
virtual bool | doesPublicKeyExist (const Name &keyName)=0 |
Check if the specified key already exists. More... | |
virtual void | getAllCertificateNames (std::vector< Name > &nameList, bool isDefault)=0 |
Get all the certificate name in public info. More... | |
virtual void | getAllCertificateNamesOfKey (const Name &keyName, std::vector< Name > &nameList, bool isDefault)=0 |
Get all the certificate name of a particular key name. More... | |
virtual void | getAllIdentities (std::vector< Name > &nameList, bool isDefault)=0 |
Get all the identities from public info. More... | |
virtual void | getAllKeyNames (std::vector< Name > &nameList, bool isDefault)=0 |
Get all the key names from public info. More... | |
virtual void | getAllKeyNamesOfIdentity (const Name &identity, std::vector< Name > &nameList, bool isDefault)=0 |
Get all the key names of a particular identity. More... | |
virtual shared_ptr< IdentityCertificate > | getCertificate (const Name &certificateName)=0 |
Get a shared pointer to identity certificate object from the identity storage. More... | |
shared_ptr< IdentityCertificate > | getDefaultCertificate () |
Get cached default certificate of the default identity. More... | |
Name | getDefaultCertificateName () |
Get the default certificate name of the default identity. More... | |
Name | getDefaultCertificateNameForIdentity (const Name &identityName) |
Get the default certificate name for the specified identity. More... | |
virtual Name | getDefaultCertificateNameForKey (const Name &keyName)=0 |
Get name of the default certificate name for the specified key. More... | |
virtual Name | getDefaultIdentity ()=0 |
Get name of the default identity. More... | |
virtual Name | getDefaultKeyNameForIdentity (const Name &identityName)=0 |
Get name of the default key name for the specified identity. More... | |
Name | getNewKeyName (const Name &identityName, bool useKsk) |
Generate a key name for the identity. More... | |
std::string | getPibLocator () |
Get PIB Locator. More... | |
virtual shared_ptr< PublicKey > | getPublicKey (const Name &keyName)=0 |
Get shared pointer to PublicKey object from the identity storage. More... | |
virtual KeyType | getPublicKeyType (const Name &keyName)=0 |
Get the type of the queried public key. More... | |
virtual std::string | getTpmLocator ()=0 |
Get TPM Locator. More... | |
void | refreshDefaultCertificate () |
try to get the default certificate of the default identity from the public info More... | |
virtual bool | revokeIdentity ()=0 |
Revoke the identity. More... | |
void | setDefaultCertificateNameForKey (const Name &certificateName) |
Set the default certificate name for the corresponding key. More... | |
void | setDefaultIdentity (const Name &identityName) |
Set the default identity. More... | |
void | setDefaultKeyNameForIdentity (const Name &keyName) |
Set the default key name for the corresponding identity. More... | |
virtual void | setTpmLocator (const std::string &tpmLocator)=0 |
Set the corresponding TPM information to tpmLocator . More... | |
Protected Member Functions | |
virtual std::string | getScheme ()=0 |
return the scheme of the PibLocator More... | |
virtual void | setDefaultCertificateNameForKeyInternal (const Name &certificateName)=0 |
Set the default certificate name for the corresponding key. More... | |
virtual void | setDefaultIdentityInternal (const Name &identityName)=0 |
Set the default identity. More... | |
virtual void | setDefaultKeyNameForIdentityInternal (const Name &keyName)=0 |
Set the default key name for the corresponding identity. More... | |
Protected Attributes | |
shared_ptr< IdentityCertificate > | m_defaultCertificate |
std::string | m_location |
SecPublicInfo is a base class for the storage of public information.
It specify interfaces related to public information, such as identity, public keys and certificates.
Definition at line 40 of file v1/sec-public-info.hpp.
|
explicit |
Definition at line 28 of file sec-public-info.cpp.
|
virtual |
The virtual Destructor.
Definition at line 33 of file sec-public-info.cpp.
|
pure virtual |
Add a certificate to the identity storage.
It will add the corresponding public key and identity if they do not exist
certificate | The certificate to be added |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
void ndn::security::v1::SecPublicInfo::addCertificateAsIdentityDefault | ( | const IdentityCertificate & | certificate | ) |
Add a certificate into the public key identity storage and set the certificate as the default one of its corresponding identity.
certificate | The certificate to be added |
SecPublicInfo::Error | if the certificate cannot be added (though it is really rare) |
Definition at line 117 of file sec-public-info.cpp.
void ndn::security::v1::SecPublicInfo::addCertificateAsKeyDefault | ( | const IdentityCertificate & | certificate | ) |
Add a certificate and set the certificate as the default one of its corresponding key.
certificate | The certificate to be added |
SecPublicInfo::Error | if the certificate cannot be added (though it is really rare) |
Definition at line 109 of file sec-public-info.cpp.
void ndn::security::v1::SecPublicInfo::addCertificateAsSystemDefault | ( | const IdentityCertificate & | certificate | ) |
Add a certificate into the public key identity storage and set the certificate as the default one of the default identity.
certificate | The certificate to be added |
SecPublicInfo::Error | if the certificate cannot be added (though it is really rare) |
Definition at line 128 of file sec-public-info.cpp.
|
pure virtual |
Add a new identity.
if identity already exist, do not add it again
identityName | The identity name to be added |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Add a public key to the identity storage.
keyName | The name of the public key to be added |
publicKey | Reference to the PublicKey object |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
void ndn::security::v1::SecPublicInfo::addPublicKey | ( | const Name & | keyName, |
KeyType | keyType, | ||
const PublicKey & | publicKey | ||
) |
Add a public key to the identity storage.
keyName | The name of the public key to be added |
keyType | Type of the public key to be added |
publicKey | Reference to the PublicKey object |
Definition at line 44 of file sec-public-info.cpp.
shared_ptr< IdentityCertificate > ndn::security::v1::SecPublicInfo::defaultCertificate | ( | ) |
Get cached default certificate of the default identity.
Definition at line 140 of file sec-public-info.cpp.
|
pure virtual |
Delete a certificate.
certificateName | The certificate name |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Delete an identity and related public keys and certificates.
identity | The identity name |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Delete a public key and related certificates.
keyName | The key name |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Check if the specified certificate already exists.
certificateName | The name of the certificate |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Check if the specified identity already exists.
identityName | The identity name |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Check if the specified key already exists.
keyName | The name of the key |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get all the certificate name in public info.
[out] | nameList | On return, the certificate name list |
isDefault | If specified, only the default certificates are returned |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get all the certificate name of a particular key name.
keyName | The specified key name | |
[out] | nameList | On return, the certificate name list |
isDefault | If specified, only the default certificate is returned |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get all the identities from public info.
[out] | nameList | On return, the identity list |
isDefault | If specified, only the default identity is returned |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get all the key names from public info.
[out] | nameList | On return, the key name list. |
isDefault | If specified, only the default keys are returned |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get all the key names of a particular identity.
identity | The specified identity name | |
[out] | nameList | On return, the key name list |
isDefault | If specified, only the default key is returned |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get a shared pointer to identity certificate object from the identity storage.
certificateName | The name of the requested certificate |
SecPublicInfo::Error | if the certificate does not exist |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
shared_ptr< IdentityCertificate > ndn::security::v1::SecPublicInfo::getDefaultCertificate | ( | ) |
Get cached default certificate of the default identity.
Definition at line 146 of file sec-public-info.cpp.
Name ndn::security::v1::SecPublicInfo::getDefaultCertificateName | ( | ) |
Get the default certificate name of the default identity.
SecPublicInfo::Error | if no certificate is found |
Definition at line 77 of file sec-public-info.cpp.
Name ndn::security::v1::SecPublicInfo::getDefaultCertificateNameForIdentity | ( | const Name & | identityName | ) |
Get the default certificate name for the specified identity.
identityName | The identity name |
SecPublicInfo::Error | if no certificate is found |
Definition at line 71 of file sec-public-info.cpp.
|
pure virtual |
Get name of the default certificate name for the specified key.
keyName | The key name. |
SecPublicInfo::Error | if there is no default. |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get name of the default identity.
SecPublicInfo::Error | if there is no default. |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get name of the default key name for the specified identity.
identityName | The identity name |
SecPublicInfo::Error | if there is no default |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
Generate a key name for the identity.
identityName | The identity name |
useKsk | If true, generate a KSK name, otherwise a DSK name |
Definition at line 89 of file sec-public-info.cpp.
std::string ndn::security::v1::SecPublicInfo::getPibLocator | ( | ) |
Get PIB Locator.
Definition at line 38 of file sec-public-info.cpp.
|
pure virtual |
Get shared pointer to PublicKey object from the identity storage.
keyName | The name of the requested public key |
SecPublicInfo::Error | if public key does not exist |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
pure virtual |
Get the type of the queried public key.
keyName | The name of the requested public key |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
protectedpure virtual |
return the scheme of the PibLocator
|
pure virtual |
Get TPM Locator.
SecPublicInfo::Error | if the TPM info does not exist |
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
void ndn::security::v1::SecPublicInfo::refreshDefaultCertificate | ( | ) |
try to get the default certificate of the default identity from the public info
Definition at line 152 of file sec-public-info.cpp.
|
pure virtual |
Revoke the identity.
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
void ndn::security::v1::SecPublicInfo::setDefaultCertificateNameForKey | ( | const Name & | certificateName | ) |
Set the default certificate name for the corresponding key.
certificateName | The certificate name |
SecPublicInfo::Error | if either the certificate or key does not exist |
Definition at line 64 of file sec-public-info.cpp.
|
protectedpure virtual |
Set the default certificate name for the corresponding key.
certificateName | The certificate name |
SecPublicInfo::Error | if the certificate does not exist |
void ndn::security::v1::SecPublicInfo::setDefaultIdentity | ( | const Name & | identityName | ) |
Set the default identity.
identityName | The default identity name |
SecPublicInfo::Error | if the identity does not exist |
Definition at line 50 of file sec-public-info.cpp.
|
protectedpure virtual |
Set the default identity.
identityName | The default identity name |
void ndn::security::v1::SecPublicInfo::setDefaultKeyNameForIdentity | ( | const Name & | keyName | ) |
Set the default key name for the corresponding identity.
keyName | The key name |
SecPublicInfo::Error | if either the identity or key does not exist |
Definition at line 57 of file sec-public-info.cpp.
|
protectedpure virtual |
Set the default key name for the corresponding identity.
keyName | The key name |
SecPublicInfo::Error | if the key does not exist |
|
pure virtual |
Set the corresponding TPM information to tpmLocator
.
If the provided tpmLocator
is different from the existing one, the PIB will be reset, otherwise nothing will be changed.
For legacy issue, the TPM info may not exist (some old PIB content may not have this info), this method will simply set the TPM info as provided without changing anything else. Thus an ideal process of handling old PIB is to check if TPM info exists. If it does not exist, then set it to the default value according to configuration.
Implemented in ndn::security::v1::SecPublicInfoSqlite3.
|
protected |
Definition at line 455 of file v1/sec-public-info.hpp.
|
protected |
Definition at line 456 of file v1/sec-public-info.hpp.