@Immutable
public class CertificateManager
extends java.lang.Object
CertificateEntry
s from a CertificateRegistry
.
A CertificateManager
will store CertificateEntry
s in a CertificateRegistry
. It will also return DigitalSignatureValidator
s for validating
signatures corresponding to the CertificateEntry
s.
Constructor and Description |
---|
CertificateManager(CertificateRegistry registry)
Constructs a
CertificateManager with the specified CertificateRegistry . |
CertificateManager(CertificateRegistry registry,
com.google.common.cache.Cache<CertificateEntry.Key,com.scalar.dl.ledger.crypto.DigitalSignatureValidator> cache) |
Modifier and Type | Method and Description |
---|---|
com.scalar.dl.ledger.crypto.DigitalSignatureValidator |
getValidator(CertificateEntry.Key key)
Returns a
DigitalSignatureValidator for the given CertificateEntry.Key . |
void |
register(CertificateEntry entry)
Stores the specified
CertificateEntry in a CertificateRegistry . |
@Inject public CertificateManager(CertificateRegistry registry)
CertificateManager
with the specified CertificateRegistry
.registry
- a CertificateRegistry
public CertificateManager(CertificateRegistry registry, com.google.common.cache.Cache<CertificateEntry.Key,com.scalar.dl.ledger.crypto.DigitalSignatureValidator> cache)
public void register(CertificateEntry entry)
CertificateEntry
in a CertificateRegistry
. Will throw a
DatabaseException
if the certificate has already been registered.entry
- a CertificateEntry
public com.scalar.dl.ledger.crypto.DigitalSignatureValidator getValidator(CertificateEntry.Key key)
DigitalSignatureValidator
for the given CertificateEntry.Key
.key
- CertificateEntry.Key
DigitalSignatureValidator