Documentation ¶
Overview ¶
Package vpcrypto contains some cryptographic utilities to sign and crypt content, mostly a wrapper over openpgp API.
Index ¶
Constants ¶
const PackageCopyright = "Copyright (C) 2015, 2016 Christian Mauduit <ufoot@ufoot.org>" // PackageCopyright set by version.sh
PackageCopyright contains a short copyright notice.
const PackageEmail = "ufoot@ufoot.org" // PackageEmail set by version.sh
PackageEmail contains a contact email for the package.
const PackageLicense = "GNU GPL v3" // PackageLicense set by version.sh
PackageLicense contains a short license information.
const PackageName = "Vapor Toolkit" // PackageName set by version.sh
PackageName contains a readable name of the package, suitable for display.
const PackageTarname = "vapor" // PackageTarname set by version.sh
PackageTarname contains a short name of the package, suitable for a filename.
const PackageURL = "https://github.com/ufoot/vapor" // PackageURL set by version.sh
PackageURL contains the address of the project homepage.
const VersionMajor = 0 // VersionMajor set by version.sh
VersionMajor is the project major version.
const VersionMinor = 5 // VersionMinor set by version.sh
VersionMinor is the project minor version.
const VersionStamp = "c6a4298" // VersionStamp set by version.sh
VersionStamp is the project stamp, possibly changes for each build.
Variables ¶
This section is empty.
Functions ¶
func SymDecrypt ¶
SymDecrypt decrypts a message crypted using a symmetric password/key.
func SymEncrypt ¶
SymEncrypt encrypts a message using a symmetric password/key.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key contains a cryptographic key pair. It might only contain a public key if it has been imported from a public key export. In that case it can not be used for signing and decrypting messages.
func ImportPubKey ¶
ImportPubKey creates a key from an exported public key.
func NewKey ¶
NewKey returns a new pair of cryptographic keys. Note that this function is rather slow, it can take up to one second or more, even on a powerfull computer, so don't generate keys often.
func (Key) CheckSig ¶
CheckSig checks a signature. This can be done with a public key, even if private key is not available.
func (Key) Decrypt ¶
Decrypt decrypts a message. Note that the key must contain a private key, it is not possible to sign with a public key.
func (Key) Encrypt ¶
Encrypt encrypts a message. This can be done with a public key, even if private key is not available.