package
1.24.0-dev
Repository: https://github.com/go-gitea/gitea.git
Documentation: pkg.go.dev

# Functions

AddDeployKey add new deploy key to database and authorized_keys file.
AddGPGKey adds new public key to database.
AddPublicKey adds new public key to database and authorized_keys file.
AddPublicKeysBySource add a users public keys.
AuthorizedStringForKey creates the authorized keys string appropriate for the provided key.
CalcFingerprint calculate public key's fingerprint.
CalculateTrustStatus will calculate the TrustStatus for a commit verification within a repository There are several trust models in Gitea.
CheckPrincipalKeyString strips spaces and returns an error if the given principal contains newlines.
CheckPublicKeyString checks if the given public key string is recognized by SSH.
DeleteGPGKey deletes GPG key information in database.
GetDeployKeyByID returns deploy key by given ID.
GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.
GetGPGImportByKeyID returns the import public armored key by given KeyID.
GetPublicKeyByID returns public key by given ID.
GPGKeyToEntity retrieve the imported key and the traducted entity.
HasDeployKey returns true if public key is a deploy key of given repository.
IsDeployKeyExistByKeyID return true if there is at least one deploykey with the key id.
IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
IsErrGPGInvalidTokenSignature checks if an error is a ErrGPGInvalidTokenSignature.
IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
IsErrGPGKeyImportNotExist checks if an error is a ErrGPGKeyImportNotExist.
IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
IsErrSSHInvalidTokenSignature checks if an error is a ErrSSHInvalidTokenSignature.
PaddedKeyID show KeyID padded to 16 characters.
ParseCommitsWithSignature checks if signaute of commits are corresponding to users gpg keys.
ParseCommitWithSignature check if signature is good against keystore.
ParseCommitWithSSHSignature check if signature is good against keystore.
PublicKeyIsExternallyManaged returns whether the provided KeyID represents an externally managed Key.
PublicKeysAreExternallyManaged returns whether the provided KeyID represents an externally managed Key.
RegeneratePublicKeys regenerates the authorized_keys file.
SearchPublicKeyByContent searches content as prefix (leak e-mail part) and returns public key found.
SearchPublicKeyByContentExact searches content and returns public key found.
SSHKeyGenParsePublicKey extracts key type and length using ssh-keygen.
SSHNativeParsePublicKey extracts the key type and length using the golang SSH library.
SynchronizePublicKeys updates a users public keys.
UpdateDeployKeyCols updates deploy key information in the specified columns.
UpdatePublicKeyUpdated updates public key use time.
VerificationToken returns token for the user that will be valid in minutes (time).
VerifyGPGKey marks a GPG key as verified.
VerifySSHKey marks a SSH key as verified.

# Constants

BadDefaultSignature is used as the reason when the signature has a KeyID that matches the default Key but is not verified by the default key.
BadSignature is used as the reason when the signature has a KeyID that is in the db but no key that has that ID verifies the signature.
KeyTypeDeploy specifies the deploy key.
KeyTypePrincipal specifies the authorized principal key.
KeyTypeUser specifies the user key.
NoKeyFound is used as the reason when no key can be found to verify the signature.

# Variables

ErrKeyIsPrivate is returned when the provided key is a private key not a public key.

# Structs

CommitVerification represents a commit validation of signature.
DeployKey represents deploy key information and its relation with repository.
ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
ErrGPGInvalidTokenSignature represents a "ErrGPGInvalidTokenSignature" kind of error.
ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
ErrGPGKeyImportNotExist represents a "GPGKeyImportNotExist" kind of error.
ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
ErrKeyNotExist represents a "KeyNotExist" kind of error.
ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
ErrSSHInvalidTokenSignature represents a "ErrSSHInvalidTokenSignature" kind of error.
GPGKey represents a GPG key.
GPGKeyImport the original import of key.
ListDeployKeysOptions are options for ListDeployKeys.
PublicKey represents a user or deploy SSH public key.
SignCommit represents a commit with validation of signature.

# Type aliases

KeyType specifies the key type.