credentials

package
v0.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 12 Imported by: 0

README

credentials

import "github.com/dfns/dfns-sdk-go/credentials"

Index

type AsymmetricKeySigner

type AsymmetricKeySigner struct {
    *AsymmetricKeySignerConfig
}

func NewAsymmetricKeySigner
func NewAsymmetricKeySigner(config *AsymmetricKeySignerConfig) *AsymmetricKeySigner

NewAsymmetricKeySigner creates a new instance of AsymmetricKeySigner with the provided configuration.

func (*AsymmetricKeySigner) Sign
func (signer *AsymmetricKeySigner) Sign(userActionChallenge *credentials.UserActionChallenge) (*credentials.KeyAssertion, error)

Sign signs the given challenge using the private key and the hashing algorithm specified in the Algorithm field. If the Algorithm field is not set or invalid, it defaults to SHA256.

type AsymmetricKeySignerConfig

type AsymmetricKeySignerConfig struct {
    // PrivateKey holds the PEM-encoded private key used for signing.
    PrivateKey string
    // CredID is the identifier of the credential associated with the private key.
    CredID string
    // Algorithm specifies the hashing algorithm to use for signing. Defaults to SHA256 if not set.
    Algorithm *crypto.Hash
}

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsymmetricKeySigner

type AsymmetricKeySigner struct {
	*AsymmetricKeySignerConfig
}

func NewAsymmetricKeySigner

func NewAsymmetricKeySigner(config *AsymmetricKeySignerConfig) *AsymmetricKeySigner

NewAsymmetricKeySigner creates a new instance of AsymmetricKeySigner with the provided configuration.

func (*AsymmetricKeySigner) Sign

func (signer *AsymmetricKeySigner) Sign(
	userActionChallenge *credentials.UserActionChallenge,
) (*credentials.KeyAssertion, error)

Sign signs the given challenge using the private key and the hashing algorithm specified in the Algorithm field. If the Algorithm field is not set or invalid, it defaults to SHA256.

type AsymmetricKeySignerConfig

type AsymmetricKeySignerConfig struct {
	// PrivateKey holds the PEM-encoded private key used for signing.
	PrivateKey string
	// CredID is the identifier of the credential associated with the private key.
	CredID string
	// Algorithm specifies the hashing algorithm to use for signing. Defaults to SHA256 if not set.
	Algorithm *crypto.Hash
}

Jump to

Keyboard shortcuts

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