public class TrustAnchorContainer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TrustAnchorContainer.Error
Note that even though this is called "Error" to be consistent with the
other libraries, it extends the Java Exception class, not Error.
|
| Constructor and Description |
|---|
TrustAnchorContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all static and dynamic anchors.
|
CertificateV2 |
find(Interest interest)
Find a certificate for the given interest.
|
CertificateV2 |
find(Name keyName)
Search for a certificate across all groups (longest prefix match).
|
TrustAnchorGroup |
getGroup(String groupId)
Get the trust anchor group for the groupId.
|
void |
insert(String groupId,
CertificateV2 certificate)
Insert a static trust anchor.
|
void |
insert(String groupId,
String path,
double refreshPeriod)
Call the main insert where isDirectory is false.
|
void |
insert(String groupId,
String path,
double refreshPeriod,
boolean isDirectory)
Insert dynamic trust anchors from the path.
|
int |
size()
Get the number of trust anchors across all groups.
|
public final void insert(String groupId, CertificateV2 certificate) throws TrustAnchorContainer.Error
groupId - The certificate group id.certificate - The certificate to insert, which is copied.TrustAnchorContainer.Error - If groupId is a dynamic anchor group .public final void insert(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 insert(String groupId, String path, double refreshPeriod) throws TrustAnchorContainer.Error
TrustAnchorContainer.Errorpublic final void clear()
public final CertificateV2 find(Name keyName)
keyName - The key name prefix for searching for the certificate.public final CertificateV2 find(Interest interest)
interest - The input interest packet.public final TrustAnchorGroup getGroup(String groupId) throws TrustAnchorContainer.Error
groupId - The group ID.TrustAnchorContainer.Error - if the groupId does not exist.public final int size()
Copyright © 2019. All rights reserved.