carini

Generate GPG key with a given Creation and Expire date

Dec 23rd, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # Small script to generate GPG key with a given Creation and Expire date
  2. # faketime is used as workaroud for Expire-Date misbehaviour
  3. # TZ=UTC faketime '2019-12-01 00:00:00' gpg --batch --full-generate-key ./GenerateGPGkey.scr
  4.  
  5. # Print text as diagnostic.
  6. %echo Generating new GPG key
  7.  
  8. # Suppress actual key generation (useful for syntax checking).
  9. # %dry-run
  10.  
  11. Key-Type: default
  12. Key-Length: 4096
  13. Subkey-Type: default
  14. Subkey-Length: 2048
  15. Name-Real: $FirstName $LastName
  16. Name-Comment: $CommentString
  17. Name-Email: $mail
  18. # Creation-Date: 20191201T000000
  19. Expire-Date: 20250131T235900
  20. # Expire-Date: -1m, 5y. +1m
  21. Passphrase: $Password
  22.  
  23. # Do a commit here, so that we can later print "done" :-)
  24. %commit
  25. %echo done
Advertisement
Add Comment
Please, Sign In to add comment