client
import "github.com/bloock/bloock-sdk-go/v2/client"
Package client provides a client for interacting with the Bloock SDK.
Index
- type AuthenticityClient
- func NewAuthenticityClient() AuthenticityClient
- func NewAuthenticityClientWithConfig(configData *proto.ConfigData) AuthenticityClient
- func (c *AuthenticityClient) GenerateEcdsaKeys() (key.KeyPair, error)
- func (c *AuthenticityClient) GetSignatures(r record.Record) ([]authenticity.Signature, error)
- func (c *AuthenticityClient) Sign(r record.Record, s authenticity.Signer) (authenticity.Signature, error)
- func (c *AuthenticityClient) Verify(r record.Record) (bool, error)
- type AvailabilityClient
- func NewAvailabilityClient() AvailabilityClient
- func NewAvailabilityClientWithConfig(configData *proto.ConfigData) AvailabilityClient
- func (c *AvailabilityClient) Publish(r record.Record, publisher availability.Publisher) (string, error)
- func (c *AvailabilityClient) Retrieve(loader availability.Loader) (record.Record, error)
- type BloockClient
- type EncryptionClient
- func NewEncryptionClient() EncryptionClient
- func NewEncryptionClientWithConfig(configData *proto.ConfigData) EncryptionClient
- func (c *EncryptionClient) Decrypt(r record.Record, decrypter encryption.Encrypter) (record.Record, error)
- func (c *EncryptionClient) Encrypt(r record.Record, encrypter encryption.Encrypter) (record.Record, error)
- func (c *EncryptionClient) GenerateRsaKeyPair() (key.KeyPair, error)
- func (c *EncryptionClient) GetEncryptionAlg(r record.Record) (encryption.EncryptionAlg, error)
- type IdentityClient
- func NewIdentityClient() IdentityClient
- func NewIdentityClientWithConfig(configData *proto.ConfigData) IdentityClient
- func (c *IdentityClient) BuildCredential(issuer identity.Issuer, schemaId, holderDid string, expiration int64, version int32) identity.CredentialBuilder
- func (c *IdentityClient) BuildSchema(displayName string, schemaType, version, description string) identity.SchemaBuilder
- func (c *IdentityClient) CreateHolder(holderKey key.Key, didMethod identity.DidMethod) (identity.Holder, error)
- func (c *IdentityClient) CreateIssuer(issuerKey key.Key, publishInterval identity.PublishIntervalParams, didMethod identity.DidMethod, name, description, image string) (identity.Issuer, error)
- func (c *IdentityClient) CreateVerification(proofRequest string) (identity.VerificationReceipt, error)
- func (c *IdentityClient) ForcePublishIssuerState(issuer identity.Issuer) (identity.IssuerStateReceipt, error)
- func (c *IdentityClient) GetCredential(credentialId string) (identity.Credential, error)
- func (c *IdentityClient) GetCredentialOffer(issuer identity.Issuer, credentialId string) (string, error)
- func (c *IdentityClient) GetCredentialProof(issuerDid string, credentialId string) (identity.CredentialProof, error)
- func (c *IdentityClient) GetSchema(id string) (identity.Schema, error)
- func (c *IdentityClient) GetVerificationStatus(sessionID int64) (bool, error)
- func (c *IdentityClient) ImportIssuer(issuerKey key.Key, didMethod identity.DidMethod) (identity.Issuer, error)
- func (c *IdentityClient) RevokeCredential(credential identity.Credential, issuer identity.Issuer) (bool, error)
- func (c *IdentityClient) WaitVerification(sessionID int64, params identity.VerificationParams) (bool, error)
- type IdentityCoreClient
- type IntegrityClient
- func NewIntegrityClient() IntegrityClient
- func NewIntegrityClientWithConfig(configData *proto.ConfigData) IntegrityClient
- func (c *IntegrityClient) GetAnchor(anchorID int64) (integrity.Anchor, error)
- func (c *IntegrityClient) GetProof(records []record.Record) (integrity.Proof, error)
- func (c *IntegrityClient) SendRecords(records []record.Record) ([]integrity.RecordReceipt, error)
- func (c *IntegrityClient) ValidateRoot(root string, params integrity.NetworkParams) (uint64, error)
- func (c *IntegrityClient) VerifyProof(proof integrity.Proof) (string, error)
- func (c *IntegrityClient) VerifyRecords(records []record.Record, params integrity.NetworkParams) (uint64, error)
- func (c *IntegrityClient) WaitAnchor(anchorID int64, params integrity.AnchorParams) (integrity.Anchor, error)
- type KeyClient
- func NewKeyClient() KeyClient
- func NewKeyClientWithConfig(configData *proto.ConfigData) KeyClient
- func (c *KeyClient) ImportManagedCertificate(_type keyEntity.CertificateType, certificate []byte, params keyEntity.ImportCertificateParams) (keyEntity.ManagedCertificate, error)
- func (c *KeyClient) LoadLocalCertificate(pkcs12 []byte, password string) (keyEntity.LocalCertificate, error)
- func (c *KeyClient) LoadLocalKey(keyType keyEntity.KeyType, key string) (keyEntity.LocalKey, error)
- func (c *KeyClient) LoadManagedCertificate(id string) (keyEntity.ManagedCertificate, error)
- func (c *KeyClient) LoadManagedKey(id string) (keyEntity.ManagedKey, error)
- func (c *KeyClient) NewLocalCertificate(params keyEntity.LocalCertificateParams) (keyEntity.LocalCertificate, error)
- func (c *KeyClient) NewLocalKey(keyType keyEntity.KeyType) (keyEntity.LocalKey, error)
- func (c *KeyClient) NewManagedCertificate(params keyEntity.ManagedCertificateParams) (keyEntity.ManagedCertificate, error)
- func (c *KeyClient) NewManagedKey(params keyEntity.ManagedKeyParams) (keyEntity.ManagedKey, error)
- func (c *KeyClient) RecoverTotpAccessControl(key keyEntity.Managed, code string) (keyEntity.TotpAccessControlReceipt, error)
- func (c *KeyClient) SetupSecretAccessControl(key keyEntity.Managed, secret string, email string) error
- func (c *KeyClient) SetupTotpAccessControl(key keyEntity.Managed) (keyEntity.TotpAccessControlReceipt, error)
- type RecordBuilder
- func (b RecordBuilder) Build() (record.Record, error)
- func (b RecordBuilder) GetDetails() (record.RecordDetails, error)
- func (b RecordBuilder) WithDecrypter(decrypter encryption.Encrypter) RecordBuilder
- func (b RecordBuilder) WithEncrypter(encrypter encryption.Encrypter) RecordBuilder
- func (b RecordBuilder) WithSigner(signer authenticity.Signer) RecordBuilder
- type RecordClient
- func NewRecordClient() RecordClient
- func NewRecordClientWithConfig(configData *proto.ConfigData) RecordClient
- func (c RecordClient) FromBytes(bytes []byte) RecordBuilder
- func (c RecordClient) FromFile(file_bytes []byte) RecordBuilder
- func (c RecordClient) FromHex(hex string) RecordBuilder
- func (c RecordClient) FromJSON(json string) RecordBuilder
- func (c RecordClient) FromLoader(loader availability.Loader) RecordBuilder
- func (c RecordClient) FromRecord(record record.Record) RecordBuilder
- func (c RecordClient) FromString(str string) RecordBuilder
- type WebhookClient
AuthenticityClient
type AuthenticityClient
AuthenticityClient represents a client for interacting with the Bloock Authenticity service.
type AuthenticityClient struct {
// contains filtered or unexported fields
}
NewAuthenticityClient
func NewAuthenticityClient
func NewAuthenticityClient() AuthenticityClient
NewAuthenticityClient creates a new instance of the AuthenticityClient with default configuration.
NewAuthenticityClientWithConfig
func NewAuthenticityClientWithConfig
func NewAuthenticityClientWithConfig(configData *proto.ConfigData) AuthenticityClient
NewAuthenticityClientWithConfig creates a new instance of the AuthenticityClient with the provided configuration.
AuthenticityClient.GenerateEcdsaKeys
func (*AuthenticityClient) GenerateEcdsaKeys
func (c *AuthenticityClient) GenerateEcdsaKeys() (key.KeyPair, error)
GenerateEcdsaKeys generates ECDSA key pair for signing records. Deprecated: Will be deleted in future versions. Use KeyClient.newLocalKey function instead.
AuthenticityClient.GetSignatures
func (*AuthenticityClient) GetSignatures
func (c *AuthenticityClient) GetSignatures(r record.Record) ([]authenticity.Signature, error)
GetSignatures retrieves the signatures associated with a Bloock record.
AuthenticityClient.Sign
func (*AuthenticityClient) Sign
func (c *AuthenticityClient) Sign(r record.Record, s authenticity.Signer) (authenticity.Signature, error)
Sign signs a Bloock record using the specified signer.
AuthenticityClient.Verify
func (*AuthenticityClient) Verify
func (c *AuthenticityClient) Verify(r record.Record) (bool, error)
Verify verifies the authenticity of a Bloock record.
AvailabilityClient
type AvailabilityClient
AvailabilityClient represents a client for interacting with the Bloock Availability service.
type AvailabilityClient struct {
// contains filtered or unexported fields
}
NewAvailabilityClient
func NewAvailabilityClient
func NewAvailabilityClient() AvailabilityClient
NewAvailabilityClient creates a new instance of the AvailabilityClient with default configuration.
NewAvailabilityClientWithConfig
func NewAvailabilityClientWithConfig
func NewAvailabilityClientWithConfig(configData *proto.ConfigData) AvailabilityClient
NewAvailabilityClientWithConfig creates a new instance of the AvailabilityClient with the provided configuration.
AvailabilityClient.Publish
func (*AvailabilityClient) Publish
func (c *AvailabilityClient) Publish(r record.Record, publisher availability.Publisher) (string, error)
Publish publishes a Bloock record to the Availability service using the specified publisher.
AvailabilityClient.Retrieve
func (*AvailabilityClient) Retrieve
func (c *AvailabilityClient) Retrieve(loader availability.Loader) (record.Record, error)
Retrieve retrieves a Bloock record from the Availability service using the specified loader.
BloockClient
type BloockClient
BloockClient represents a client for interacting with the Bloock SDK.
type BloockClient struct {
AuthenticityClient AuthenticityClient
AvailabilityClient AvailabilityClient
EncryptionClient EncryptionClient
IdentityCoreClient IdentityCoreClient
IdentityClient IdentityClient
IntegrityClient IntegrityClient
KeyClient KeyClient
RecordClient RecordClient
WebhookClient WebhookClient
// contains filtered or unexported fields
}
NewBloockClient
func NewBloockClient
func NewBloockClient(apiKey string, identityApiHost *string) BloockClient
NewBloockClient creates a new instance of the Bloock SDK client with the specified configuration.
EncryptionClient
type EncryptionClient
EncryptionClient represents a client for interacting with the Bloock Encryption service.
type EncryptionClient struct {
// contains filtered or unexported fields
}
NewEncryptionClient
func NewEncryptionClient
func NewEncryptionClient() EncryptionClient
NewEncryptionClient creates a new instance of the EncryptionClient with default configuration.
NewEncryptionClientWithConfig
func NewEncryptionClientWithConfig
func NewEncryptionClientWithConfig(configData *proto.ConfigData) EncryptionClient
NewEncryptionClientWithConfig creates a new instance of the EncryptionClient with the provided configuration.
EncryptionClient.Decrypt
func (*EncryptionClient) Decrypt
func (c *EncryptionClient) Decrypt(r record.Record, decrypter encryption.Encrypter) (record.Record, error)
Decrypt decrypts a Bloock record using the specified decrypter.
EncryptionClient.Encrypt
func (*EncryptionClient) Encrypt
func (c *EncryptionClient) Encrypt(r record.Record, encrypter encryption.Encrypter) (record.Record, error)
Encrypt encrypts a Bloock record using the specified encrypter.
EncryptionClient.GenerateRsaKeyPair
func (*EncryptionClient) GenerateRsaKeyPair
func (c *EncryptionClient) GenerateRsaKeyPair() (key.KeyPair, error)
GenerateRsaKeyPair generates an RSA key pair for encryption. Deprecated: Will be deleted in future versions. Use KeyClient.newLocalKey function instead.