2019-05-15 13:40:19 +02:00
|
|
|
// Package crypto provides a high-level API for common OpenPGP functionality.
|
2018-09-11 11:09:28 +02:00
|
|
|
package crypto
|
2018-06-04 16:05:14 -07:00
|
|
|
|
2018-06-22 16:04:20 +02:00
|
|
|
import "time"
|
|
|
|
|
|
2019-05-15 13:40:19 +02:00
|
|
|
// GopenPGP is used as a "namespace" for many of the functions in this package.
|
|
|
|
|
// It is a struct that keeps track of time skew between server and client.
|
2019-05-14 18:05:01 +02:00
|
|
|
type GopenPGP struct {
|
2018-06-04 17:50:26 -07:00
|
|
|
latestServerTime int64
|
2018-06-22 16:04:20 +02:00
|
|
|
latestClientTime time.Time
|
2018-06-04 16:05:14 -07:00
|
|
|
}
|
2019-10-22 18:44:45 +02:00
|
|
|
|
|
|
|
|
var pgp = GopenPGP{}
|
2020-04-08 11:11:16 +02:00
|
|
|
|
|
|
|
|
// clone returns a clone of the byte slice. Internal function used to make sure
|
|
|
|
|
// we don't retain a reference to external data.
|
|
|
|
|
func clone(input []byte) []byte {
|
|
|
|
|
data := make([]byte, len(input))
|
|
|
|
|
copy(data, input)
|
|
|
|
|
return data
|
|
|
|
|
}
|