Documentation ¶
Index ¶
- Constants
- type CSP
- type EncryptionContext
- type EncryptionContextImpl
- type EncryptionProvider
- type EncryptionProviderImpl
- type GoCrypto
- func (g GoCrypto) DecryptMessage(key []byte, encryptedMessage []byte) ([]byte, error)
- func (g GoCrypto) EncryptMessage(key []byte, message []byte) (encryptedMessage []byte, err error)
- func (g GoCrypto) NewECDSAKeys() (publicKey []byte, privateKey []byte, err error)
- func (g GoCrypto) NewRSAKeys() (publicKey []byte, privateKey []byte, err error)
- func (g GoCrypto) NewSymmetricKey() ([]byte, error)
- func (g GoCrypto) PkDecryptMessage(privateKey []byte, encryptedMessage []byte) (message []byte, err error)
- func (g GoCrypto) PkEncryptMessage(publicKey []byte, message []byte) ([]byte, error)
- func (g GoCrypto) SignMessage(privateKey []byte, message []byte) (signature []byte, e error)
- func (g GoCrypto) VerifyMessage(publicKey []byte, message []byte, signature []byte) error
Constants ¶
View Source
const ( NonceLength = 12 SymKeyLength = 16 TagLength = 16 RSAKeyLength = 3072 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSP ¶
type CSP interface { NewRSAKeys() (publicKey []byte, privateKey []byte, e error) NewECDSAKeys() (publicKey []byte, privateKey []byte, e error) VerifyMessage(publicKey []byte, message []byte, signature []byte) error NewSymmetricKey() ([]byte, error) SignMessage(privateKey []byte, message []byte) (signature []byte, e error) PkDecryptMessage(privateKey []byte, encryptedMessage []byte) (message []byte, e error) PkEncryptMessage(publicKey []byte, message []byte) ([]byte, error) DecryptMessage(key []byte, encryptedMessage []byte) ([]byte, error) EncryptMessage(key []byte, message []byte) (encryptedMessage []byte, e error) }
CSP (Crypto Service Provider) offers a high-level abstract of cryptographic primitives used in FPC
func GetDefaultCSP ¶
func GetDefaultCSP() CSP
type EncryptionContext ¶
type EncryptionContext interface { Conceal(function string, args []string) (string, error) Reveal(r []byte) ([]byte, error) }
EncryptionContext defines the interface of an object responsible to encrypt the contents of a transaction invocation and to decrypt the corresponding response. Conceal and Reveal must be called only once during the lifetime of an object that implements this interface. That is, an EncryptionContext is only valid for a single transaction invocation.
type EncryptionContextImpl ¶
type EncryptionContextImpl struct {
// contains filtered or unexported fields
}
type EncryptionProvider ¶
type EncryptionProvider interface {
NewEncryptionContext() (EncryptionContext, error)
}
type EncryptionProviderImpl ¶
func (EncryptionProviderImpl) NewEncryptionContext ¶
func (p EncryptionProviderImpl) NewEncryptionContext() (EncryptionContext, error)
type GoCrypto ¶
type GoCrypto struct { }
GoCrypto implements CSP using pure go
func NewGoCrypto ¶
func NewGoCrypto() *GoCrypto
func (GoCrypto) DecryptMessage ¶
func (GoCrypto) EncryptMessage ¶
func (GoCrypto) NewECDSAKeys ¶
func (GoCrypto) NewRSAKeys ¶
func (GoCrypto) NewSymmetricKey ¶
func (GoCrypto) PkDecryptMessage ¶
func (GoCrypto) PkEncryptMessage ¶
func (GoCrypto) SignMessage ¶
Click to show internal directories.
Click to hide internal directories.