Documentation ¶
Index ¶
- Constants
- func CreateEDKeyFile(filename string) (err error)
- func CreateRSAKeyFile(filename string) error
- func CreateRSAPrivKeyFromBase64(strModulus string, strPrivExponent string, strPrimes []string) (privKey *rsa.PrivateKey, err error)
- func CreateRSAPubKeyFromBytes(bytModulus [COMM_KEY_LENGTH]byte) (pubKey *rsa.PublicKey, err error)
- func ExtractEDPrivKeyFromFile(filename string) (privKey ed25519.PrivateKey, err error)
- func ExtractEDPublicKeyFromFile(filename string) (pubKey ed25519.PublicKey, err error)
- func ExtractRSAKeyFromFile(filename string) (privKey *rsa.PrivateKey, err error)
- func GetAddressFromPubKeyED(pubKey ed25519.PublicKey) (address [32]byte)
- func GetPrivKeyFromStringED(publicKey string, privateKey string) (privKey ed25519.PrivateKey, err error)
- func GetPubKeyFromAddressED(address [32]byte) (pubKey ed25519.PublicKey)
- func GetPubKeyFromStringED(pub1 string) (pubKey ed25519.PublicKey, err error)
- func ReadFile(filename string) (lines []string)
- func SignMessageWithRSAKey(privKey *rsa.PrivateKey, msg string) (fixedSig [COMM_PROOF_LENGTH]byte, err error)
- func VerifyEDKey(privKey ed25519.PrivateKey, pubKey ed25519.PublicKey) error
- func VerifyMessageWithRSAKey(pubKey *rsa.PublicKey, msg string, fixedSig [COMM_PROOF_LENGTH]byte) (err error)
- func VerifyRSAKey(privKey *rsa.PrivateKey) error
Constants ¶
View Source
const ( // Note that this is the default public exponent set by Golang in rsa.go // See https://github.com/golang/go/blob/6269dcdc24d74379d8a609ce886149811020b2cc/src/crypto/rsa/rsa.go#L226 COMM_PUBLIC_EXPONENT = 65537 COMM_KEY_BITS = 2048 COMM_PROOF_LENGTH = 256 COMM_KEY_LENGTH = 256 COMM_NOF_PRIMES = 2 )
Variables ¶
This section is empty.
Functions ¶
func CreateEDKeyFile ¶
func CreateRSAKeyFile ¶
Creates an RSA key file with the following lines 1 Public Modulus N 2 Private Exponent D 3+ Private Primes (depending on COMM_NOF_PRIMES)
func CreateRSAPubKeyFromBytes ¶
func CreateRSAPubKeyFromBytes(bytModulus [COMM_KEY_LENGTH]byte) (pubKey *rsa.PublicKey, err error)
func ExtractEDPrivKeyFromFile ¶
func ExtractEDPrivKeyFromFile(filename string) (privKey ed25519.PrivateKey, err error)
func ExtractRSAKeyFromFile ¶
func ExtractRSAKeyFromFile(filename string) (privKey *rsa.PrivateKey, err error)
func GetAddressFromPubKeyED ¶
func GetPrivKeyFromStringED ¶
func GetPrivKeyFromStringED(publicKey string, privateKey string) (privKey ed25519.PrivateKey, err error)
func GetPubKeyFromAddressED ¶
func GetPubKeyFromStringED ¶
func SignMessageWithRSAKey ¶
func SignMessageWithRSAKey(privKey *rsa.PrivateKey, msg string) (fixedSig [COMM_PROOF_LENGTH]byte, err error)
func VerifyEDKey ¶
func VerifyEDKey(privKey ed25519.PrivateKey, pubKey ed25519.PublicKey) error
func VerifyMessageWithRSAKey ¶
func VerifyRSAKey ¶
func VerifyRSAKey(privKey *rsa.PrivateKey) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.