package timestamp
import "github.com/theupdateframework/notary/server/timestamp"
Index ¶
- func GetOrCreateTimestamp(gun data.GUN, store storage.MetaStore, cryptoService signed.CryptoService) ( *time.Time, []byte, error)
- func GetOrCreateTimestampKey(gun data.GUN, store storage.MetaStore, crypto signed.CryptoService, createAlgorithm string) (data.PublicKey, error)
- func RotateTimestampKey(gun data.GUN, store storage.MetaStore, crypto signed.CryptoService, createAlgorithm string) (data.PublicKey, error)
Functions ¶
func GetOrCreateTimestamp ¶
func GetOrCreateTimestamp(gun data.GUN, store storage.MetaStore, cryptoService signed.CryptoService) ( *time.Time, []byte, error)
GetOrCreateTimestamp returns the current timestamp for the gun. This may mean a new timestamp is generated either because none exists, or because the current one has expired. Once generated, the timestamp is saved in the store. Additionally, if we had to generate a new snapshot for this timestamp, it is also saved in the store
func GetOrCreateTimestampKey ¶
func GetOrCreateTimestampKey(gun data.GUN, store storage.MetaStore, crypto signed.CryptoService, createAlgorithm string) (data.PublicKey, error)
GetOrCreateTimestampKey returns the timestamp key for the gun. It uses the store to lookup an existing timestamp key and the crypto to generate a new one if none is found. It attempts to handle the race condition that may occur if 2 servers try to create the key at the same time by simply querying the store a second time if it receives a conflict when writing.
func RotateTimestampKey ¶
func RotateTimestampKey(gun data.GUN, store storage.MetaStore, crypto signed.CryptoService, createAlgorithm string) (data.PublicKey, error)
RotateTimestampKey attempts to rotate a timestamp key in the signer, but might be rate-limited by the signer
Source Files ¶
- Version
- v0.7.0 (latest)
- Published
- Jan 14, 2021
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 12 hours ago –
Tools for package owners.