Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToPemBlock(data []byte, blockType string) *pem.Block
- func EnsureDirectoryExists(dir string) error
- func GenerateAndSaveRSAPair(dir string, filename string) (*rsa.PrivateKey, error)
- func GenerateRSAPair() (*rsa.PrivateKey, error)
- func HashPublicKey(public interface{}) (string, error)
- func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)
- func LoadPublicKey(filename string) (*rsa.PublicKey, error)
- func MarshalPrivateKey(private *rsa.PrivateKey) []byte
- func MarshalPublicKey(public *rsa.PublicKey) ([]byte, error)
- func ParsePrivateKey(data string) (*rsa.PrivateKey, error)
- func ParsePublicKey(data string) (*rsa.PublicKey, error)
- func RestorePrivateKeyFromPemDate(data []byte) (*rsa.PrivateKey, error)
- func RestorePublicKeyFromPemData(data []byte) (*rsa.PublicKey, error)
- func SavePrivateKey(private *rsa.PrivateKey, dir string, filename string) error
- func SavePublicKey(public *rsa.PublicKey, dir string, filename string) error
- func SignMessage(private *rsa.PrivateKey, message interface{}) (string, error)
- func StringifyPrivateKey(private *rsa.PrivateKey) string
- func StringifyPublicKey(public *rsa.PublicKey) (string, error)
- func VerifySignature(public interface{}, message interface{}, signature string) error
Constants ¶
View Source
const ( SportstalkPrivateKey = "SPORTSTALK PRIVATE KEY" SportstalkPublicKey = "SPORTSTALK PUBLIC KEY" )
Variables ¶
View Source
var (
ErrInvalidPublicKey = fmt.Errorf("invalid public key")
)
Functions ¶
func EnsureDirectoryExists ¶
func GenerateAndSaveRSAPair ¶
func GenerateAndSaveRSAPair(dir string, filename string) (*rsa.PrivateKey, error)
func GenerateRSAPair ¶
func GenerateRSAPair() (*rsa.PrivateKey, error)
func HashPublicKey ¶
func LoadPrivateKey ¶
func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)
func MarshalPrivateKey ¶
func MarshalPrivateKey(private *rsa.PrivateKey) []byte
func ParsePrivateKey ¶
func ParsePrivateKey(data string) (*rsa.PrivateKey, error)
func RestorePrivateKeyFromPemDate ¶
func RestorePrivateKeyFromPemDate(data []byte) (*rsa.PrivateKey, error)
func SavePrivateKey ¶
func SavePrivateKey(private *rsa.PrivateKey, dir string, filename string) error
func SignMessage ¶
func SignMessage(private *rsa.PrivateKey, message interface{}) (string, error)
func StringifyPrivateKey ¶
func StringifyPrivateKey(private *rsa.PrivateKey) string
func VerifySignature ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.