util

package
v0.0.0-...-55a0270 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Version_1_0                     = "1.0"
	Version_1_1                     = "1.1"
	SchemaTypeReference_v1_0        = "https://credentials.workday.com/docs/specification/v1.0/schema.json"
	DIDDocTypeReference_v1_0        = "https://credentials.workday.com/docs/specification/v1.0/did-doc.json"
	RevocationTypeReference_v1_0    = "https://credentials.workday.com/docs/specification/v1.0/revocation.json"
	CredentialTypeReference_v1_0    = "https://credentials.workday.com/docs/specification/v1.0/credential.json"
	ProofRequestTypeReference_v1_0  = "https://credentials.workday.com/docs/specification/v1.0/proof-request.json"
	ProofResponseTypeReference_v1_0 = "https://credentials.workday.com/docs/specification/v1.0/proof-response.json"
)

Variables

View Source
var (
	UUIDRegExp = regexp.MustCompile(`^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$`)
)

Functions

func AddNonceToDoc

func AddNonceToDoc(unsignedDoc []byte, nonce string) []byte

func Base58ToBase64

func Base58ToBase64(encodedBase58 string) (string, error)

Base64ToBase58 converts a base58 encoded string into a base64 encoded string. Returns an error if the original string was not base58 encoded.

func Base64ToBase58

func Base64ToBase58(encodedBase64 string) (string, error)

Base64ToBase58 converts a base64 encoded string into a base58 encoded string. Returns an error if the original string was not base64 encoded.

func DeepCopy

func DeepCopy(from interface{}, to interface{}) error

DeepCopy makes a deep copy from "from" into "to". Unlike a shallow copy, a deep copy will follow pointers. The caller should be mindful of the objects that will be created.

func ExtractPublicKeyFromBase58Der

func ExtractPublicKeyFromBase58Der(encodedBase58 string) ([]byte, error)

ExtractPublicKeyFromBase58Der extracts a public key from a base58 encoded Distinguished Encoding Rules (DER) formatted string.

func GetNonce

func GetNonce() string

func IsPtrOrSlice

func IsPtrOrSlice(unknown interface{}) bool

IsPtrOrSlice returns true if the object is either a pointer or a slice.

func JSONBytesEqual

func JSONBytesEqual(a, b []byte) (bool, error)

JSONBytesEqual compares the JSON in two byte slices for deep equality, ignoring whitespace and other non-semantically meaningful formatting differences.

func StrToPtr

func StrToPtr(s string) *string

func StringSliceContains

func StringSliceContains(slice []string, value string) bool

Types

type CommonError

type CommonError string

func (CommonError) Error

func (err CommonError) Error() string

type Emptyable

type Emptyable interface {
	IsEmpty() bool
}

type Validateable

type Validateable interface {
	ValidateStatic() error
}

Directories

Path Synopsis
ion
pow

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL