code.gitea.io/gitea@v1.19.3/modules/structs/user_gpgkey.go (about)

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