Documentation ¶
Index ¶
- Constants
- func AddCommonFlags(cmd *cobra.Command)
- func GetDuration(cmd *cobra.Command, flagName, envKey string, defaultDuration time.Duration) (time.Duration, error)
- func GetKey(cmd *cobra.Command, ...) (interface{}, error)
- func GetPublicKeyFromKMS(cmd *cobra.Command, keyIDFlagName, keyIDEnvKey string, ...) (interface{}, error)
- func GetServices(serviceFilePath string) ([]docdid.Service, error)
- func GetVDRPublicKeysFromFile(publicKeyFilePath string) (*docdid.Doc, error)
- func NewHTTPClient(cmd *cobra.Command) (*http.Client, error)
- func ParsePrivateKey(der []byte) (crypto.PrivateKey, error)
- func Printf(out io.Writer, msg string, args ...interface{})
- func Println(out io.Writer, msg string)
- func PrivateKeyFromFile(file string, password []byte) (crypto.PrivateKey, error)
- func PrivateKeyFromPEM(privateKeyPEM, password []byte) (crypto.PrivateKey, error)
- func PublicKeyFromFile(file string) (crypto.PublicKey, error)
- func PublicKeyFromPEM(pubKeyPEM []byte) (crypto.PublicKey, error)
- func SendHTTPRequest(cmd *cobra.Command, reqBytes []byte, method, endpointURL string) ([]byte, error)
- func SendRequest(httpClient *http.Client, req []byte, headers map[string]string, ...) ([]byte, error)
- type ActivityPubClient
- type ActivityPubCollectionIterator
- type PublicKey
- type Signer
Constants ¶
const ( // TLSSystemCertPoolFlagName defines the flag for the system certificate pool. TLSSystemCertPoolFlagName = "tls-systemcertpool" // TLSSystemCertPoolFlagUsage defines the usage of the system certificate pool flag. TLSSystemCertPoolFlagUsage = "Use system certificate pool." + " Possible values [true] [false]. Defaults to false if not set." + " Alternatively, this can be set with the following environment variable: " + TLSSystemCertPoolEnvKey // TLSSystemCertPoolEnvKey defines the environment variable for the system certificate pool flag. TLSSystemCertPoolEnvKey = "ORB_CLI_TLS_SYSTEMCERTPOOL" // TLSCACertsFlagName defines the flag for the CA certs flag. TLSCACertsFlagName = "tls-cacerts" // TLSCACertsFlagUsage defines the usage of the CA certs flag. TLSCACertsFlagUsage = "Comma-separated list of ca certs path." + " Alternatively, this can be set with the following environment variable: " + TLSCACertsEnvKey // TLSCACertsEnvKey defines the environment variable for the CA certs flag. TLSCACertsEnvKey = "ORB_CLI_TLS_CACERTS" // AuthTokenFlagName defines the flag for the authorization bearer token. AuthTokenFlagName = "auth-token" // AuthTokenFlagUsage defines the usage of the authorization bearer token flag. AuthTokenFlagUsage = "Auth token." + " Alternatively, this can be set with the following environment variable: " + AuthTokenEnvKey // AuthTokenEnvKey defines the environment variable for the authorization bearer token flag. AuthTokenEnvKey = "ORB_CLI_AUTH_TOKEN" //nolint:gosec // TargetOverrideFlagName defines the flag for specifying target overrides. TargetOverrideFlagName = "target-override" // TargetOverrideFlagUsage defines the flag for target override usage. TargetOverrideFlagUsage = "Overrides one or more targets used for resolving HTTP endpoints. " + " For example, --target-override orb.domain2.com->localhost:48426 will use localhost:48426 instead of" + " orb.domain2.com for HTTP requests. This flag should only be used for testing." + " Alternatively, this can be set with the following environment variable: " + TargetOverrideEnvKey // TargetOverrideEnvKey defines the flag for target override environment variable. TargetOverrideEnvKey = "ORB_CLI_OUTBOX_URL" )
Variables ¶
This section is empty.
Functions ¶
func AddCommonFlags ¶
AddCommonFlags adds common flags to the given command.
func GetDuration ¶
func GetDuration(cmd *cobra.Command, flagName, envKey string, defaultDuration time.Duration, ) (time.Duration, error)
GetDuration get duration.
func GetKey ¶
func GetKey(cmd *cobra.Command, keyFlagName, keyEnvKey, keyFileFlagName, keyFileEnvKey string, password []byte, privateKey bool, ) (interface{}, error)
GetKey get key.
func GetPublicKeyFromKMS ¶
func GetPublicKeyFromKMS(cmd *cobra.Command, keyIDFlagName, keyIDEnvKey string, webKmsClient kms.KeyManager, ) (interface{}, error)
GetPublicKeyFromKMS get publickey from kms.
func GetServices ¶
GetServices get services.
func GetVDRPublicKeysFromFile ¶
GetVDRPublicKeysFromFile get public keys from file.
func NewHTTPClient ¶
NewHTTPClient returns a new HTTP client using the arguments from the given command.
func ParsePrivateKey ¶
func ParsePrivateKey(der []byte) (crypto.PrivateKey, error)
ParsePrivateKey parse private key.
func PrivateKeyFromFile ¶
func PrivateKeyFromFile(file string, password []byte) (crypto.PrivateKey, error)
PrivateKeyFromFile private key from file.
func PrivateKeyFromPEM ¶
func PrivateKeyFromPEM(privateKeyPEM, password []byte) (crypto.PrivateKey, error)
PrivateKeyFromPEM private key pem.
func PublicKeyFromFile ¶
PublicKeyFromFile public key from file.
func PublicKeyFromPEM ¶
PublicKeyFromPEM public key from pem.
Types ¶
type ActivityPubClient ¶
type ActivityPubClient struct {
// contains filtered or unexported fields
}
ActivityPubClient reads ActivityPub actors and collections from the service endpoint.
func NewActivityPubClient ¶
func NewActivityPubClient(cmd *cobra.Command) (*ActivityPubClient, error)
NewActivityPubClient returns a new ActivityPub client.
func (*ActivityPubClient) CollectionContains ¶
CollectionContains returns true if the given ActivityPub collection contains the given IRI.
func (*ActivityPubClient) GetCollection ¶
func (c *ActivityPubClient) GetCollection(collURI *url.URL) (*ActivityPubCollectionIterator, error)
GetCollection returns an ActivityPub collection iterator for the given collection IRI.
func (*ActivityPubClient) ResolveActor ¶
func (c *ActivityPubClient) ResolveActor(actorEndpoint string) (*vocab.ActorType, error)
ResolveActor returns the actor for the given endpoint.
type ActivityPubCollectionIterator ¶
type ActivityPubCollectionIterator struct {
// contains filtered or unexported fields
}
ActivityPubCollectionIterator iterates over an ActivityPub collection.
type PublicKey ¶
type PublicKey struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Purposes []string `json:"purposes,omitempty"` JWKPath string `json:"jwkPath,omitempty"` B58Key string `json:"b58Key,omitempty"` }
PublicKey struct.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer operation.
func NewSigner ¶
func NewSigner(signingkey crypto.PrivateKey, signingKeyID string, webKmsCryptoClient webcrypto.Crypto, signingKeyPK crypto.PublicKey, ) *Signer
NewSigner return new signer.
func (*Signer) PublicKeyJWK ¶
PublicKeyJWK return public key JWK.