URISchemeValidator
public final class URISchemeValidator : Sendable
Validates and signs SEP-0007 compliant Stellar URIs.
This class provides functionality for signing URI scheme requests and verifying their authenticity by validating signatures against the origin domain’s stellar.toml file. It ensures URI requests come from legitimate sources by checking cryptographic signatures.
See: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md
-
Undocumented
Declaration
Swift
public init() -
Signs a SEP-0007 compliant URL with the signer’s key pair.
Generates a signature for the URI and appends it as the
signatureparameter.Declaration
Swift
public func signURI(url: String, signerKeyPair: KeyPair) -> SignURLEnumParameters
urlThe SEP-0007 compliant URI to be signed
signerKeyPairThe key pair used to generate the signature
Return Value
SignURLEnum with the signed URL on success, or an error on failure
-
checkURISchemeIsValid(url:Asynchronous) Validates a SEP-0007 URI by verifying its signature against the origin domain’s stellar.toml.
Checks that:
- The
origin_domainparameter is present and is a valid fully qualified domain name - The domain’s stellar.toml contains a
URI_REQUEST_SIGNING_KEY - The
signatureparameter is present and valid for the signing key
Declaration
Swift
public func checkURISchemeIsValid(url: String) async -> URISchemeIsValidEnumParameters
urlThe SEP-0007 compliant URI to validate
Return Value
URISchemeIsValidEnum indicating success or the specific validation error
- The
View on GitHub
Install in Dash