CastorImpl

class CastorImpl constructor(val apollo: Apollo, logger: PrismLogger = PrismLoggerImpl(LogComponent.CASTOR)) : Castor(source)

Castor is a powerful and flexible library for working with DIDs. Whether you are building a decentralised application or a more traditional system requiring secure and private identity management, Castor provides the tools and features you need to easily create, manage, and resolve DIDs.

Constructors

Link copied to clipboard
constructor(apollo: Apollo, logger: PrismLogger = PrismLoggerImpl(LogComponent.CASTOR))

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addResolver(resolver: DIDResolver)
Link copied to clipboard
open override fun createPeerDID(keyPairs: Array<KeyPair>, services: Array<DIDDocument.Service>): DID

Creates a DID for a peer (a device or server that acts as a DID subject) using given key agreement and authentication key pairs and a list of services.

Link copied to clipboard
open override fun createPrismDID(masterPublicKey: PublicKey, services: Array<DIDDocument.Service>?): DID

Creates a DID for a prism (a device or server that acts as a DID owner and controller) using a given master public key and list of services.

Link copied to clipboard

Extract list of PublicKey from a list of DIDDocumentCoreProperty.

Link copied to clipboard
open override fun parseDID(did: String): DID

Parses a string representation of a Decentralized Identifier (DID) into a DID object.

Link copied to clipboard
open suspend override fun resolveDID(did: String): DIDDocument

Asynchronously resolves a DID to its corresponding DID Document. This function may throw an error if the DID is invalid or the document cannot be retrieved.

Link copied to clipboard
open suspend override fun verifySignature(did: DID, challenge: ByteArray, signature: ByteArray): Boolean

Verifies the authenticity of a signature using the corresponding DID Document, challenge, and signature data. This function returns a boolean value indicating whether the signature is valid or not. This function may throw an error if the DID Document or signature data are invalid.