TrustManagerLocal

class TrustManagerLocal(storage: Storage, val identifier: String = "default", partitionId: String = "default_") : TrustManager

An implementation of TrustManager using a local persistent store of entries that provide trust points.

For management, this includes addX509Cert, addVical, getEntries and deleteEntry methods.

Parameters

storage

the Storage to use.

identifier

an identifier for the TrustManager.

partitionId

an identifier to use if multiple TrustManagerLocal instances share the same storage.

Constructors

Link copied to clipboard
constructor(storage: Storage, identifier: String = "default", partitionId: String = "default_")

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val identifier: String

Functions

Link copied to clipboard
suspend fun addVical(encodedSignedVical: ByteString, metadata: TrustMetadata): TrustEntryVical

Adds a new entry with a signed VICAL.

Link copied to clipboard
suspend fun addX509Cert(certificate: X509Cert, metadata: TrustMetadata): TrustEntryX509Cert

Adds a new entry for CAs identified by a X.509 certificate.

Link copied to clipboard
suspend fun deleteEntry(entry: TrustEntry): Boolean

Removes a TrustEntry previously added with addX509Cert or addVical.

Link copied to clipboard
suspend fun getEntries(): List<TrustEntry>

Gets a list of all entries added with addX509Cert or addVical.

Link copied to clipboard
suspend fun getEntry(id: String): TrustEntry

Gets a TrustEntry by id.

Link copied to clipboard
open suspend override fun getTrustPoints(): List<TrustPoint>

Gets all trust points known to this TrustManager instance.

Link copied to clipboard
suspend fun updateMetadata(entry: TrustEntry, metadata: TrustMetadata): TrustEntry

Updates metadata for an entry.

Link copied to clipboard
open suspend override fun verify(chain: List<X509Cert>, atTime: Instant): TrustResult

Checks if an entity identifying itself via a certificate chain is trusted.