Discover Packages
github.com/go-magma/magma/lib/go
security
key
package
Version:
v1.1.1
Opens a new window with list of versions in this module.
Published: Aug 18, 2020
License: BSD-3-Clause
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 6
Opens a new window with list of known importers.
Documentation
Documentation
¶
func GenerateKey(ecdsaCurve string , rsaBits int ) (priv interface{}, err error )
return a private key generated using rsa or ecdsa.
if param ecdsaCurve is empty string, then rsa with 'rsaBits' will be used;
otherwise corresponding ecdsa algorithm will be used and 'rsaBits' is ignored.
func PublicKey(priv interface{}) interface{}
returns 'public part' of the passed asymmetric encryption algo key 'priv'
func ReadKey(keyFile string ) (priv interface{}, err error )
read and parse private key from 'keyFile', return the 'priv' key
in the form of either *rsa.PrivateKey or *ecdsa.PrivateKey
write private key 'priv' into 'keyFile' in ASN.1 DER format
type of 'priv' can be *rsa.PrivateKey or *ecdsa.PrivateKey
Source Files
¶
Click to show internal directories.
Click to hide internal directories.