CachingSigningKeyDatabase using the OpenSSH allowed signers file
and the OpenSSH key revocation list.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final HashMap | |
| private AtomicInteger | |
| private static final int | |
| private final HashMap |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearCache()
Implements org. Discards any cached data. |
| public int | getCacheSize()
Implements org. Retrieves the current cache size. |
| private File | |
| public String | isAllowed(Repository
Repository the key is being used inGpgConfig to usePublicKey to checkof the signature namespace, PersonIdent optional ident)PersonIdent giving a signer's e-mail address
and a signature timeImplements org. Checks whether the given key is allowed to be used for signing, and if allowed returns the principal. |
| public boolean | isRevoked(Repository
Repository the key is being used inGpgConfig to usePublicKey to checkImplements org. Determines whether the gives key has been revoked. |
| private void | |
| private void | |
| public void | setCacheSize(int
the cache size, ignored if this database does not have a
cache. size)Implements org. Sets the cache size to use. |
| allowedSigners | back to summary |
|---|---|
| private final HashMap<Path, AllowedSigners> allowedSigners | |
| cacheSize | back to summary |
|---|---|
| private AtomicInteger cacheSize | |
| DEFAULT_CACHE_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_CACHE_SIZE | |
| revocations | back to summary |
|---|---|
| private final HashMap<Path, OpenSshKrl> revocations | |
| OpenSshSigningKeyDatabase | back to summary |
|---|---|
| public OpenSshSigningKeyDatabase() | |
| clearCache | back to summary |
|---|---|
| public void clearCache() Implements org. Doc from org. Discards any cached data. A no-op if the database has no cache.
| |
| getCacheSize | back to summary |
|---|---|
| public int getCacheSize() Implements org. Doc from org. Retrieves the current cache size.
| |
| getFile | back to summary |
|---|---|
| private File getFile(Repository repository, String fileName) throws IOException | |
| isAllowed | back to summary |
|---|---|
| public String isAllowed(Repository repository, GpgConfig config, PublicKey key, String namespace, PersonIdent ident) throws IOException, VerificationException Implements org. Doc from org. Checks whether the given key is allowed to be used for signing, and if allowed returns the principal.
| |
| isRevoked | back to summary |
|---|---|
| public boolean isRevoked(Repository repository, GpgConfig config, PublicKey key) throws IOException Implements org. Doc from org. Determines whether the gives key has been revoked.
| |
| prune | back to summary |
|---|---|
| private void prune(HashMap<?, ?> map, int size) | |
| pruneCache | back to summary |
|---|---|
| private void pruneCache(int size) | |
| setCacheSize | back to summary |
|---|---|
| public void setCacheSize(int size) Implements org. Doc from org. Sets the cache size to use.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | removeEldestEntry(Map.
The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed if this
method returns eldesttrue. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.Overrides java. Returns |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| LRU | back to summary |
|---|---|
| pack-priv LRU() | |
| removeEldestEntry | back to summary |
|---|---|
| protected boolean removeEldestEntry(Map. Overrides java. Doc from java. Returns Sample use: this override will allow the map to grow up to 100 entries and then delete the eldest entry each time a new entry is added, maintaining a steady state of 100 entries.
private static final int MAX_ENTRIES = 100;
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
This method typically does not modify the map in any way,
instead allowing the map to modify itself as directed by its
return value. It is permitted for this method to modify
the map directly, but if it does so, it must return
This implementation merely returns
| |