You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user_gpgkey.go 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2017 Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package structs
  4. import (
  5. "time"
  6. )
  7. // GPGKey a user GPG key to sign commit and tag in repository
  8. type GPGKey struct {
  9. ID int64 `json:"id"`
  10. PrimaryKeyID string `json:"primary_key_id"`
  11. KeyID string `json:"key_id"`
  12. PublicKey string `json:"public_key"`
  13. Emails []*GPGKeyEmail `json:"emails"`
  14. SubsKey []*GPGKey `json:"subkeys"`
  15. CanSign bool `json:"can_sign"`
  16. CanEncryptComms bool `json:"can_encrypt_comms"`
  17. CanEncryptStorage bool `json:"can_encrypt_storage"`
  18. CanCertify bool `json:"can_certify"`
  19. Verified bool `json:"verified"`
  20. // swagger:strfmt date-time
  21. Created time.Time `json:"created_at,omitempty"`
  22. // swagger:strfmt date-time
  23. Expires time.Time `json:"expires_at,omitempty"`
  24. }
  25. // GPGKeyEmail an email attached to a GPGKey
  26. // swagger:model GPGKeyEmail
  27. type GPGKeyEmail struct {
  28. Email string `json:"email"`
  29. Verified bool `json:"verified"`
  30. }
  31. // CreateGPGKeyOption options create user GPG key
  32. type CreateGPGKeyOption struct {
  33. // An armored GPG key to add
  34. //
  35. // required: true
  36. // unique: true
  37. ArmoredKey string `json:"armored_public_key" binding:"Required"`
  38. Signature string `json:"armored_signature,omitempty"`
  39. }
  40. // VerifyGPGKeyOption options verifies user GPG key
  41. type VerifyGPGKeyOption struct {
  42. // An Signature for a GPG key token
  43. //
  44. // required: true
  45. KeyID string `json:"key_id" binding:"Required"`
  46. Signature string `json:"armored_signature" binding:"Required"`
  47. }