Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountIEC

func ByteCountIEC(b int64) string

    ByteCountIEC -

    func ByteCountSI

    func ByteCountSI(b int64) string

      ByteCountSI -

      func BytesToPrivateKey

      func BytesToPrivateKey(priv []byte) *rsa.PrivateKey

        BytesToPrivateKey bytes to private key

        func BytesToPublicKey

        func BytesToPublicKey(pub []byte) *rsa.PublicKey

          BytesToPublicKey bytes to public key

          func CreateHash

          func CreateHash(key string) string

            CreateHash -

            func CreateHashByte

            func CreateHashByte(key []byte) string

              CreateHashByte -

              func Decrypt

              func Decrypt(data []byte, passphrase string) []byte

                Decrypt -

                func DecryptWithPrivateKey

                func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte

                  DecryptWithPrivateKey decrypts data with private key

                  func Encrypt

                  func Encrypt(data []byte, passphrase string) []byte

                    Encrypt -

                    func EncryptWithPublicKey

                    func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) []byte

                      EncryptWithPublicKey -

                      func GenerateKeyPair

                      func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey)

                        GenerateKeyPair generates a new key pair

                        func GenerateUUID

                        func GenerateUUID() string

                          GenerateUUID -

                          func PrivateKeyToBytes

                          func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte

                            PrivateKeyToBytes private key to bytes

                            func PublicKeyToBytes

                            func PublicKeyToBytes(pub *rsa.PublicKey) []byte

                              PublicKeyToBytes public key to bytes

                              Types

                              type Certificate

                              type Certificate struct {
                              	CACert     []byte
                              	CAKey      []byte
                              	ServerCert []byte
                              	ServerKey  []byte
                              }

                                Certificate -

                                func GenerateCA

                                func GenerateCA(keySize int) (cert Certificate, err error)

                                  GenerateCA -

                                  func GenerateCert

                                  func GenerateCert(keySize int, domain []string, alips []string) (cert Certificate, err error)

                                    GenerateCert -

                                    Source Files