Versions in this module Expand all Collapse all v0 v0.1.0 Feb 15, 2016 Changes in this version + const AESKeyLength + const NonceSize + var DefaultCurve = elliptic.P384() + var ErrAlreadyInitialized = errors.New("Already initialized.") + var ErrAlreadyRegistered = errors.New("Already registered.") + var ErrDecrypt = errors.New("Decryption failed.") + var ErrDirrentChaincodeID = errors.New("ChaincodeIDs are different.") + var ErrEncrypt = errors.New("Encryption failed.") + var ErrInvalidConfidentialityLevel = errors.New("Invalid confidentiality level") + var ErrInvalidReference = errors.New("Invalid reference.") + var ErrInvalidSignature = errors.New("Invalid Signature.") + var ErrInvalidTransactionSignature = errors.New("Invalid Transaction Signature.") + var ErrKeyStoreAlreadyInitialized = errors.New("Keystore already Initilized.") + var ErrNilArgument = errors.New("Nil argument.") + var ErrNotImplemented = errors.New("Not implemented.") + var ErrNotInitialized = errors.New("Initialization required.") + var ErrRegistrationRequired = errors.New("Registration to the Membership Service required.") + var ErrTransactionCertificate = errors.New("Missing Transaction Certificate.") + var ErrTransactionMissingCert = errors.New("Transaction missing certificate or signature.") + var ErrTransactionSignature = errors.New("Missing Transaction Signature.") + var TCertEncTCertIndex = asn1.ObjectIdentifier + func AEStoEncryptedPEM(raw []byte, pwd []byte) ([]byte, error) + func AEStoPEM(raw []byte) []byte + func CBCDecrypt(key, src []byte) ([]byte, error) + func CBCEncrypt(key, s []byte) ([]byte, error) + func CBCPKCS7Decrypt(key, src []byte) ([]byte, error) + func CBCPKCS7Encrypt(key, src []byte) ([]byte, error) + func CheckCertAgainRoot(x509Cert *x509.Certificate, certPool *x509.CertPool) ([][]*x509.Certificate, error) + func CheckCertAgainstSKAndRoot(x509Cert *x509.Certificate, privateKey interface{}, certPool *x509.CertPool) error + func CheckCertPKAgainstSK(x509Cert *x509.Certificate, privateKey interface{}) error + func Clone(src []byte) []byte + func DERCertToPEM(der []byte) []byte + func DERToPrivateKey(der []byte) (interface{}, error) + func DERToX509Certificate(asn1Data []byte) (*x509.Certificate, error) + func DecodeBase64(in string) ([]byte, error) + func DirEmpty(path string) (bool, error) + func DirExists(path string) (bool, error) + func DirMissingOrEmpty(path string) (bool, error) + func ECDSASign(signKey interface{}, msg []byte) ([]byte, error) + func ECDSASignDirect(signKey interface{}, msg []byte) (*big.Int, *big.Int, error) + func ECDSAVerify(verKey interface{}, msg, signature []byte) (bool, error) + func EncodeBase64(in []byte) string + func ErrToString(err error) string + func FileMissing(path string, name string) (bool, error) + func FilePathMissing(path string) (bool, error) + func GenAESKey() ([]byte, error) + func GetCriticalExtension(cert *x509.Certificate, oid asn1.ObjectIdentifier) ([]byte, error) + func GetRandomBytes(len int) ([]byte, error) + func HMAC(key, x []byte) []byte + func HMACTruncated(key, x []byte, truncation int) []byte + func Hash(msg []byte) []byte + func IntArrayEquals(a []int, b []int) bool + func IsTCPPortOpen(laddr string) error + func NewECDSAKey() (*ecdsa.PrivateKey, error) + func NewHash() hash.Hash + func NewSelfSignedCert() ([]byte, interface{}, error) + func PEMtoAES(raw []byte, pwd []byte) ([]byte, error) + func PEMtoCertificate(raw []byte) (*x509.Certificate, error) + func PEMtoCertificateAndDER(raw []byte) (*x509.Certificate, []byte, error) + func PEMtoDER(raw []byte) ([]byte, error) + func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error) + func PKCS7Padding(src []byte) []byte + func PKCS7UnPadding(src []byte) ([]byte, error) + func PrivateKeyToDER(privateKey *ecdsa.PrivateKey) ([]byte, error) + func PrivateKeyToEncryptedPEM(privateKey interface{}, pwd []byte) ([]byte, error) + func PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error) + func PublicKeyToPEM(algo string, publicKey interface{}) ([]byte, error) + func VerifySignCapability(tempSK interface{}, certPK interface{}) error + type ECDSASignature struct + R *big.Int + S *big.Int + type NodeConfiguration struct + Name string + Type string + func (conf *NodeConfiguration) GetEnrollmentID() string + func (conf *NodeConfiguration) GetEnrollmentPWD() string