Documentation
¶
Overview ¶
Package iron is a Go implementation of the Iron library.
Index ¶
Constants ¶
View Source
const ( MacFormatVersion = "2" // The signature base string version. MacPrefix = "Fe26." + MacFormatVersion // The Iron ticket prefix. )
Ticket format constants.
View Source
const ( AES256KeyBits = 256 // The AES-256 encryption key size. IVBits = 128 // The AES-256 IV size. IntegrityKeyBits = 256 // The HMAC-SHA256 key size. )
Key and IV sizes.
Variables ¶
View Source
var DefaultAlgorithm = Algorithm{
SaltBits: 256,
Iterations: 1,
}
Default algorithm options.
View Source
var Defaults = Options{ Encryption: DefaultAlgorithm, Integrity: DefaultAlgorithm, ExpireIn: 0, AcceptWithin: 1 * time.Minute, LocalOffset: 0, }
Default options.
View Source
var DefaultsIntegrity = Algorithm{
SaltBits: 256,
Iterations: 1,
}
Default integrity algorithm options.
Functions ¶
Types ¶
type Algorithm ¶
type Algorithm struct {
SaltBits int // The salt size. Defaults to 256 bits.
Iterations int // The number of PBKDF2 iterations. Defaults to 1.
}
Algorithm specifies encryption and integrity algorithm options.
type Options ¶
type Options struct {
Encryption Algorithm // Payload encryption options.
Integrity Algorithm // Signature generation options.
ExpireIn time.Duration // Ticket lifetime. If omitted or 0, the ticket will never expire.
AcceptWithin time.Duration // The window for accepting expired tickets. Defaults to 1 minute.
LocalOffset time.Duration // The local clock time offset. Defaults to 0.
}
Options specifies encryption and decryption options.
Click to show internal directories.
Click to hide internal directories.