rsasignature

package module
v0.0.0-...-8b3a22e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2018 License: MIT Imports: 13 Imported by: 0

README

Go RSA sign/verify example

build status

License

Licensed under MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePKIXPublicKeyPEM

func DecodePKIXPublicKeyPEM(publicKeyPEM []byte) (*rsa.PublicKey, error)

DecodePKIXPublicKeyPEM decodes DER encoded RSA public key PEM

func DecodePrivateKeyPEM

func DecodePrivateKeyPEM(privateKeyPEM []byte) (*rsa.PrivateKey, error)

DecodePrivateKeyPEM decodes RSA PKCS#1 v1.5 private key

func EncodePKIXPublicKeyPEM

func EncodePKIXPublicKeyPEM(publicKey *rsa.PublicKey) ([]byte, error)

EncodePKIXPublicKeyPEM serialises a public key to DER-encoded PKIX format

func EncodePrivateKeyPEM

func EncodePrivateKeyPEM(privateKey *rsa.PrivateKey) ([]byte, error)

EncodePrivateKeyPEM encodes RSA PKCS#1 v1.5 private key

func Sign

func Sign(privateKeyPEM, bytesToSign []byte) (string, error)

Sign returns base64 encoded signature using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5

func Verify

func Verify(publicKeyPEM []byte, signature string, signed []byte) (bool, error)

Verify verifies an RSA PKCS#1 v1.5 signature

Types

This section is empty.

Jump to

Keyboard shortcuts

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