Skip to content

Commit

Permalink
Check if ExpirationDate is set (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
leibowitz authored and dominikschulz committed Feb 3, 2017
1 parent 9189e9f commit 49bfc37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gpg/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ type Key struct {

// IsUseable returns true if GPG would assume this key is useable for encryption
func (k Key) IsUseable() bool {
if k.ExpirationDate.Before(time.Now()) {
if !k.ExpirationDate.IsZero() && k.ExpirationDate.Before(time.Now()) {
return false
}
switch k.Validity {
Expand Down

0 comments on commit 49bfc37

Please sign in to comment.