You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// createPrismDID 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. This function may throw an error if the master public key or services are invalid.
/// The Castor protocol defines the set of decentralized identifier (DID) operations that are used in the Atala PRISM architecture. It provides a way for users to create, manage, and control their DIDs and associated cryptographic keys.
4
14
publicprotocolCastor{
5
15
/// parseDID parses a string representation of a Decentralized Identifier (DID) into a DID object. This function may throw an error if the string is not a valid DID.
@@ -8,6 +18,18 @@ public protocol Castor {
8
18
/// - Returns: The DID object
9
19
/// - Throws: An error if the string is not a valid DID
10
20
func parseDID(str:String)throws->DID
21
+
22
+
/// createDID creates a DID for a method using a given an array of public keys and list of services. This function may throw an error.
23
+
/// - Parameters:
24
+
/// - method: DID Method to use (ex: prism, peer)
25
+
/// - keys: An array of Tuples with the public key and the key purpose
26
+
/// - services: The list of services
27
+
/// - Returns: The created DID
28
+
func createDID(
29
+
method:DIDMethod,
30
+
keys:[(KeyPurpose,PublicKey)],
31
+
services:[DIDDocument.Service]
32
+
)throws->DID
11
33
12
34
/// createPrismDID 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. This function may throw an error if the master public key or services are invalid.
0 commit comments