| Modifier and Type | Field and Description |
|---|---|
protected TrustAnchorContainer |
trustAnchors_ |
protected CertificateCacheV2 |
unverifiedCertificateCache_ |
protected CertificateCacheV2 |
verifiedCertificateCache_ |
| Constructor and Description |
|---|
CertificateStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheUnverifiedCertificate(CertificateV2 certificate)
Cache the unverified certificate for a period of time (5 minutes).
|
void |
cacheVerifiedCertificate(CertificateV2 certificate)
Cache the verified certificate a period of time (1 hour).
|
CertificateV2 |
findTrustedCertificate(Interest interestForCertificate)
Find a trusted certificate in the trust anchor container or in the
verified cache.
|
TrustAnchorContainer |
getTrustAnchors()
Get the trust anchor container.
|
CertificateCacheV2 |
getUnverifiedCertificateCache()
Get the unverified certificate cache.
|
CertificateCacheV2 |
getVerifiedCertificateCache()
Get the verified certificate cache.
|
boolean |
isCertificateKnown(Name certificatePrefix)
Check if the certificate with the given name prefix exists in the verified
cache, the unverified cache, or in the set of trust anchors.
|
void |
loadAnchor(String groupId,
CertificateV2 certificate)
Load a static trust anchor.
|
void |
loadAnchor(String groupId,
String path,
double refreshPeriod)
Load dynamic trust anchors.
|
void |
loadAnchor(String groupId,
String path,
double refreshPeriod,
boolean isDirectory)
Load dynamic trust anchors.
|
void |
resetAnchors()
Remove any previously loaded static or dynamic trust anchors.
|
void |
resetVerifiedCertificates()
Remove any cached verified certificates.
|
void |
setCacheNowOffsetMilliseconds_(double nowOffsetMilliseconds)
Set the offset when the cache insert() and refresh() get the current time,
which should only be used for testing.
|
protected TrustAnchorContainer trustAnchors_
protected CertificateCacheV2 verifiedCertificateCache_
protected CertificateCacheV2 unverifiedCertificateCache_
public final CertificateV2 findTrustedCertificate(Interest interestForCertificate)
interestForCertificate - The Interest for the certificate.public final boolean isCertificateKnown(Name certificatePrefix)
certificatePrefix - The certificate name prefix.public final void cacheUnverifiedCertificate(CertificateV2 certificate) throws CertificateV2.Error
certificate - The certificate packet, which is copied.CertificateV2.Errorpublic final TrustAnchorContainer getTrustAnchors()
public final CertificateCacheV2 getVerifiedCertificateCache()
public final CertificateCacheV2 getUnverifiedCertificateCache()
public final void loadAnchor(String groupId, CertificateV2 certificate) throws TrustAnchorContainer.Error
groupId - The certificate group id.certificate - The certificate to load as a trust anchor, which is
copied.TrustAnchorContainer.Errorpublic final void loadAnchor(String groupId, String path, double refreshPeriod, boolean isDirectory) throws TrustAnchorContainer.Error
groupId - The certificate group id, which must not be empty.path - The path to load the trust anchors.refreshPeriod - The refresh time in milliseconds for the anchors
under path. This must be positive. The relevant trust anchors will only be
updated when find is called.isDirectory - If true, then path is a directory. If false, it is a
single file.IllegalArgumentException - If refreshPeriod is not positive.TrustAnchorContainer.Error - a group with groupId already existspublic final void loadAnchor(String groupId, String path, double refreshPeriod) throws TrustAnchorContainer.Error
groupId - The certificate group id, which must not be empty.path - The path of the single file to load the trust anchors.refreshPeriod - The refresh time in milliseconds for the anchors
under path. This must be positive. The relevant trust anchors will only be
updated when find is called.IllegalArgumentException - If refreshPeriod is not positive.TrustAnchorContainer.Error - a group with groupId already existspublic final void resetAnchors()
public final void cacheVerifiedCertificate(CertificateV2 certificate) throws CertificateV2.Error
certificate - The certificate object, which is copied.CertificateV2.Errorpublic final void resetVerifiedCertificates()
public final void setCacheNowOffsetMilliseconds_(double nowOffsetMilliseconds)
nowOffsetMilliseconds - The offset in milliseconds.Copyright © 2019. All rights reserved.