security

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package security provides Go bindings for android.security.

Index

Constants

View Source
const (
	Creator                           = consts.Creator
	ErrorAttestationChallengeTooLarge = consts.ErrorAttestationChallengeTooLarge
	ErrorAttestationKeysUnavailable   = consts.ErrorAttestationKeysUnavailable
	ErrorIdAttestationFailure         = consts.ErrorIdAttestationFailure
	ErrorIncorrectUsage               = consts.ErrorIncorrectUsage
	ErrorInternalSystemError          = consts.ErrorInternalSystemError
	ErrorKeymintFailure               = consts.ErrorKeymintFailure
	ErrorKeystoreFailure              = consts.ErrorKeystoreFailure
	ErrorKeystoreUninitialized        = consts.ErrorKeystoreUninitialized
	ErrorKeyCorrupted                 = consts.ErrorKeyCorrupted
	ErrorKeyDoesNotExist              = consts.ErrorKeyDoesNotExist
	ErrorKeyNotTemporallyValid        = consts.ErrorKeyNotTemporallyValid
	ErrorKeyOperationExpired          = consts.ErrorKeyOperationExpired
	ErrorOther                        = consts.ErrorOther
	ErrorPermissionDenied             = consts.ErrorPermissionDenied
	ErrorUnimplemented                = consts.ErrorUnimplemented
	ErrorUserAuthenticationRequired   = consts.ErrorUserAuthenticationRequired
	RetryAfterNextReboot              = consts.RetryAfterNextReboot
	RetryNever                        = consts.RetryNever
	RetryWhenConnectivityAvailable    = consts.RetryWhenConnectivityAvailable
	RetryWithExponentialBackoff       = consts.RetryWithExponentialBackoff
)
View Source
const (
	ActionKeychainChanged   = consts.ActionKeychainChanged
	ActionKeyAccessChanged  = consts.ActionKeyAccessChanged
	ActionStorageChanged    = consts.ActionStorageChanged
	ActionTrustStoreChanged = consts.ActionTrustStoreChanged
	ExtraCertificate        = consts.ExtraCertificate
	ExtraKeyAccessible      = consts.ExtraKeyAccessible
	ExtraKeyAlias           = consts.ExtraKeyAlias
	ExtraName               = consts.ExtraName
	ExtraPkcs12             = consts.ExtraPkcs12
	KeyAliasSelectionDenied = consts.KeyAliasSelectionDenied
)

Variables

This section is empty.

Functions

func Init

func Init(env *jni.Env) error

Init resolves all JNI class and method references for this package. It is safe to call multiple times (uses sync.Once internally). Exported for E2E testing on Android.

Types

type AppUriAuthenticationPolicy

type AppUriAuthenticationPolicy struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

AppUriAuthenticationPolicy wraps android.security.AppUriAuthenticationPolicy.

func (*AppUriAuthenticationPolicy) DescribeContents

func (m *AppUriAuthenticationPolicy) DescribeContents() (int32, error)

DescribeContents calls android.security.AppUriAuthenticationPolicy.describeContents.

func (*AppUriAuthenticationPolicy) Equals

func (m *AppUriAuthenticationPolicy) Equals(arg0 *jni.Object) (bool, error)

Equals calls android.security.AppUriAuthenticationPolicy.equals.

func (*AppUriAuthenticationPolicy) HashCode

func (m *AppUriAuthenticationPolicy) HashCode() (int32, error)

HashCode calls android.security.AppUriAuthenticationPolicy.hashCode.

func (*AppUriAuthenticationPolicy) ToString

func (m *AppUriAuthenticationPolicy) ToString() (string, error)

ToString calls android.security.AppUriAuthenticationPolicy.toString.

func (*AppUriAuthenticationPolicy) WriteToParcel

func (m *AppUriAuthenticationPolicy) WriteToParcel(arg0 *jni.Object, arg1 int32) error

WriteToParcel calls android.security.AppUriAuthenticationPolicy.writeToParcel.

type AppUriAuthenticationPolicyBuilder

type AppUriAuthenticationPolicyBuilder struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

AppUriAuthenticationPolicyBuilder wraps android.security.AppUriAuthenticationPolicy$Builder.

func (*AppUriAuthenticationPolicyBuilder) AddAppAndUriMapping

func (m *AppUriAuthenticationPolicyBuilder) AddAppAndUriMapping(
	arg0 string,
	arg1 *jni.Object,
	arg2 string,
) (*jni.Object, error)

AddAppAndUriMapping calls android.security.AppUriAuthenticationPolicy$Builder.addAppAndUriMapping.

func (*AppUriAuthenticationPolicyBuilder) Build

Build calls android.security.AppUriAuthenticationPolicy$Builder.build.

type AttestedKeyPair

type AttestedKeyPair struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

AttestedKeyPair wraps android.security.AttestedKeyPair.

func NewAttestedKeyPair

func NewAttestedKeyPair(vm *jni.VM, arg0 *jni.Object, arg1 *jni.Object) (*AttestedKeyPair, error)

NewAttestedKeyPair creates a new android.security.AttestedKeyPair instance.

func (*AttestedKeyPair) GetKeyPair

func (m *AttestedKeyPair) GetKeyPair() (*jni.Object, error)

GetKeyPair calls android.security.AttestedKeyPair.getKeyPair.

type ConfirmationAlreadyPresentingException

type ConfirmationAlreadyPresentingException struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ConfirmationAlreadyPresentingException wraps android.security.ConfirmationAlreadyPresentingException.

func NewConfirmationAlreadyPresentingException

func NewConfirmationAlreadyPresentingException(vm *jni.VM) (*ConfirmationAlreadyPresentingException, error)

NewConfirmationAlreadyPresentingException creates a new android.security.ConfirmationAlreadyPresentingException instance.

type ConfirmationCallback

type ConfirmationCallback struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ConfirmationCallback wraps android.security.ConfirmationCallback.

func (*ConfirmationCallback) OnCanceled

func (m *ConfirmationCallback) OnCanceled() error

OnCanceled calls android.security.ConfirmationCallback.onCanceled.

func (*ConfirmationCallback) OnConfirmed

func (m *ConfirmationCallback) OnConfirmed(arg0 *jni.Object) error

OnConfirmed calls android.security.ConfirmationCallback.onConfirmed.

func (*ConfirmationCallback) OnDismissed

func (m *ConfirmationCallback) OnDismissed() error

OnDismissed calls android.security.ConfirmationCallback.onDismissed.

func (*ConfirmationCallback) OnError

func (m *ConfirmationCallback) OnError(arg0 *jni.Object) error

OnError calls android.security.ConfirmationCallback.onError.

type ConfirmationNotAvailableException

type ConfirmationNotAvailableException struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ConfirmationNotAvailableException wraps android.security.ConfirmationNotAvailableException.

func NewConfirmationNotAvailableException

func NewConfirmationNotAvailableException(vm *jni.VM) (*ConfirmationNotAvailableException, error)

NewConfirmationNotAvailableException creates a new android.security.ConfirmationNotAvailableException instance.

type ConfirmationPrompt

type ConfirmationPrompt struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ConfirmationPrompt wraps android.security.ConfirmationPrompt.

func (*ConfirmationPrompt) CancelPrompt

func (m *ConfirmationPrompt) CancelPrompt() error

CancelPrompt calls android.security.ConfirmationPrompt.cancelPrompt.

func (*ConfirmationPrompt) IsSupported

func (m *ConfirmationPrompt) IsSupported(arg0 *jni.Object) (bool, error)

IsSupported calls android.security.ConfirmationPrompt.isSupported.

func (*ConfirmationPrompt) PresentPrompt

func (m *ConfirmationPrompt) PresentPrompt(arg0 *jni.Object, arg1 *jni.Object) error

PresentPrompt calls android.security.ConfirmationPrompt.presentPrompt.

type ConfirmationPromptBuilder

type ConfirmationPromptBuilder struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

ConfirmationPromptBuilder wraps android.security.ConfirmationPrompt$Builder.

func (*ConfirmationPromptBuilder) Build

func (m *ConfirmationPromptBuilder) Build() (*jni.Object, error)

Build calls android.security.ConfirmationPrompt$Builder.build.

func (*ConfirmationPromptBuilder) SetExtraData

func (m *ConfirmationPromptBuilder) SetExtraData(arg0 *jni.Object) (*jni.Object, error)

SetExtraData calls android.security.ConfirmationPrompt$Builder.setExtraData.

func (*ConfirmationPromptBuilder) SetPromptText

func (m *ConfirmationPromptBuilder) SetPromptText(arg0 string) (*jni.Object, error)

SetPromptText calls android.security.ConfirmationPrompt$Builder.setPromptText.

type FileIntegrityManager

type FileIntegrityManager struct {
	VM  *jni.VM
	Ctx *app.Context
	Obj *jni.GlobalRef
}

FileIntegrityManager wraps android.security.FileIntegrityManager.

func NewFileIntegrityManager

func NewFileIntegrityManager(ctx *app.Context) (*FileIntegrityManager, error)

NewFileIntegrityManager obtains android.security.FileIntegrityManager from the Android system service manager.

func (*FileIntegrityManager) Close

func (m *FileIntegrityManager) Close()

Close releases the global reference to the underlying Java object. After Close, the FileIntegrityManager must not be used.

func (*FileIntegrityManager) IsApkVeritySupported

func (m *FileIntegrityManager) IsApkVeritySupported() (bool, error)

IsApkVeritySupported calls android.security.FileIntegrityManager.isApkVeritySupported.

func (*FileIntegrityManager) IsAppSourceCertificateTrusted

func (m *FileIntegrityManager) IsAppSourceCertificateTrusted(arg0 *jni.Object) (bool, error)

IsAppSourceCertificateTrusted calls android.security.FileIntegrityManager.isAppSourceCertificateTrusted.

type KeyChain

type KeyChain struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyChain wraps android.security.KeyChain.

func NewKeyChain

func NewKeyChain(vm *jni.VM) (*KeyChain, error)

NewKeyChain creates a new android.security.KeyChain instance.

func (*KeyChain) ChoosePrivateKeyAlias6

func (m *KeyChain) ChoosePrivateKeyAlias6(
	arg0 *jni.Object,
	arg1 *jni.Object,
	arg2 *jni.Object,
	arg3 *jni.Object,
	arg4 *jni.Object,
	arg5 string,
) error

ChoosePrivateKeyAlias6 calls android.security.KeyChain.choosePrivateKeyAlias.

func (*KeyChain) ChoosePrivateKeyAlias7_1

func (m *KeyChain) ChoosePrivateKeyAlias7_1(
	arg0 *jni.Object,
	arg1 *jni.Object,
	arg2 *jni.Object,
	arg3 *jni.Object,
	arg4 string,
	arg5 int32,
	arg6 string,
) error

ChoosePrivateKeyAlias7_1 calls android.security.KeyChain.choosePrivateKeyAlias.

func (*KeyChain) CreateInstallIntent

func (m *KeyChain) CreateInstallIntent() (*jni.Object, error)

CreateInstallIntent calls android.security.KeyChain.createInstallIntent.

func (*KeyChain) CreateManageCredentialsIntent

func (m *KeyChain) CreateManageCredentialsIntent(arg0 *jni.Object) (*jni.Object, error)

CreateManageCredentialsIntent calls android.security.KeyChain.createManageCredentialsIntent.

func (*KeyChain) GetCertificateChain

func (m *KeyChain) GetCertificateChain(arg0 *jni.Object, arg1 string) (*jni.Object, error)

GetCertificateChain calls android.security.KeyChain.getCertificateChain.

func (*KeyChain) GetCredentialManagementAppPolicy

func (m *KeyChain) GetCredentialManagementAppPolicy(arg0 *jni.Object) (*jni.Object, error)

GetCredentialManagementAppPolicy calls android.security.KeyChain.getCredentialManagementAppPolicy.

func (*KeyChain) GetPrivateKey

func (m *KeyChain) GetPrivateKey(arg0 *jni.Object, arg1 string) (*jni.Object, error)

GetPrivateKey calls android.security.KeyChain.getPrivateKey.

func (*KeyChain) IsBoundKeyAlgorithm

func (m *KeyChain) IsBoundKeyAlgorithm(arg0 string) (bool, error)

IsBoundKeyAlgorithm calls android.security.KeyChain.isBoundKeyAlgorithm.

func (*KeyChain) IsCredentialManagementApp

func (m *KeyChain) IsCredentialManagementApp(arg0 *jni.Object) (bool, error)

IsCredentialManagementApp calls android.security.KeyChain.isCredentialManagementApp.

func (*KeyChain) IsKeyAlgorithmSupported

func (m *KeyChain) IsKeyAlgorithmSupported(arg0 string) (bool, error)

IsKeyAlgorithmSupported calls android.security.KeyChain.isKeyAlgorithmSupported.

func (*KeyChain) RemoveCredentialManagementApp

func (m *KeyChain) RemoveCredentialManagementApp(arg0 *jni.Object) (bool, error)

RemoveCredentialManagementApp calls android.security.KeyChain.removeCredentialManagementApp.

type KeyChainAliasCallback

type KeyChainAliasCallback struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyChainAliasCallback wraps android.security.KeyChainAliasCallback.

func (*KeyChainAliasCallback) Alias

func (m *KeyChainAliasCallback) Alias(arg0 string) error

Alias calls android.security.KeyChainAliasCallback.alias.

type KeyChainException

type KeyChainException struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyChainException wraps android.security.KeyChainException.

func NewKeyChainException

func NewKeyChainException(vm *jni.VM) (*KeyChainException, error)

NewKeyChainException creates a new android.security.KeyChainException instance.

type KeyPairGeneratorSpec

type KeyPairGeneratorSpec struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyPairGeneratorSpec wraps android.security.KeyPairGeneratorSpec.

func (*KeyPairGeneratorSpec) GetAlgorithmParameterSpec

func (m *KeyPairGeneratorSpec) GetAlgorithmParameterSpec() (*jni.Object, error)

GetAlgorithmParameterSpec calls android.security.KeyPairGeneratorSpec.getAlgorithmParameterSpec.

func (*KeyPairGeneratorSpec) GetContext

func (m *KeyPairGeneratorSpec) GetContext() (*jni.Object, error)

GetContext calls android.security.KeyPairGeneratorSpec.getContext.

func (*KeyPairGeneratorSpec) GetEndDate

func (m *KeyPairGeneratorSpec) GetEndDate() (*jni.Object, error)

GetEndDate calls android.security.KeyPairGeneratorSpec.getEndDate.

func (*KeyPairGeneratorSpec) GetKeySize

func (m *KeyPairGeneratorSpec) GetKeySize() (int32, error)

GetKeySize calls android.security.KeyPairGeneratorSpec.getKeySize.

func (*KeyPairGeneratorSpec) GetKeyType

func (m *KeyPairGeneratorSpec) GetKeyType() (string, error)

GetKeyType calls android.security.KeyPairGeneratorSpec.getKeyType.

func (*KeyPairGeneratorSpec) GetKeystoreAlias

func (m *KeyPairGeneratorSpec) GetKeystoreAlias() (string, error)

GetKeystoreAlias calls android.security.KeyPairGeneratorSpec.getKeystoreAlias.

func (*KeyPairGeneratorSpec) GetSerialNumber

func (m *KeyPairGeneratorSpec) GetSerialNumber() (*jni.Object, error)

GetSerialNumber calls android.security.KeyPairGeneratorSpec.getSerialNumber.

func (*KeyPairGeneratorSpec) GetStartDate

func (m *KeyPairGeneratorSpec) GetStartDate() (*jni.Object, error)

GetStartDate calls android.security.KeyPairGeneratorSpec.getStartDate.

func (*KeyPairGeneratorSpec) GetSubjectDN

func (m *KeyPairGeneratorSpec) GetSubjectDN() (*jni.Object, error)

GetSubjectDN calls android.security.KeyPairGeneratorSpec.getSubjectDN.

func (*KeyPairGeneratorSpec) IsEncryptionRequired

func (m *KeyPairGeneratorSpec) IsEncryptionRequired() (bool, error)

IsEncryptionRequired calls android.security.KeyPairGeneratorSpec.isEncryptionRequired.

type KeyPairGeneratorSpecBuilder

type KeyPairGeneratorSpecBuilder struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyPairGeneratorSpecBuilder wraps android.security.KeyPairGeneratorSpec$Builder.

func (*KeyPairGeneratorSpecBuilder) Build

Build calls android.security.KeyPairGeneratorSpec$Builder.build.

func (*KeyPairGeneratorSpecBuilder) SetAlgorithmParameterSpec

func (m *KeyPairGeneratorSpecBuilder) SetAlgorithmParameterSpec(arg0 *jni.Object) (*jni.Object, error)

SetAlgorithmParameterSpec calls android.security.KeyPairGeneratorSpec$Builder.setAlgorithmParameterSpec.

func (*KeyPairGeneratorSpecBuilder) SetAlias

func (m *KeyPairGeneratorSpecBuilder) SetAlias(arg0 string) (*jni.Object, error)

SetAlias calls android.security.KeyPairGeneratorSpec$Builder.setAlias.

func (*KeyPairGeneratorSpecBuilder) SetEncryptionRequired

func (m *KeyPairGeneratorSpecBuilder) SetEncryptionRequired() (*jni.Object, error)

SetEncryptionRequired calls android.security.KeyPairGeneratorSpec$Builder.setEncryptionRequired.

func (*KeyPairGeneratorSpecBuilder) SetEndDate

func (m *KeyPairGeneratorSpecBuilder) SetEndDate(arg0 *jni.Object) (*jni.Object, error)

SetEndDate calls android.security.KeyPairGeneratorSpec$Builder.setEndDate.

func (*KeyPairGeneratorSpecBuilder) SetKeySize

func (m *KeyPairGeneratorSpecBuilder) SetKeySize(arg0 int32) (*jni.Object, error)

SetKeySize calls android.security.KeyPairGeneratorSpec$Builder.setKeySize.

func (*KeyPairGeneratorSpecBuilder) SetKeyType

func (m *KeyPairGeneratorSpecBuilder) SetKeyType(arg0 string) (*jni.Object, error)

SetKeyType calls android.security.KeyPairGeneratorSpec$Builder.setKeyType.

func (*KeyPairGeneratorSpecBuilder) SetSerialNumber

func (m *KeyPairGeneratorSpecBuilder) SetSerialNumber(arg0 *jni.Object) (*jni.Object, error)

SetSerialNumber calls android.security.KeyPairGeneratorSpec$Builder.setSerialNumber.

func (*KeyPairGeneratorSpecBuilder) SetStartDate

func (m *KeyPairGeneratorSpecBuilder) SetStartDate(arg0 *jni.Object) (*jni.Object, error)

SetStartDate calls android.security.KeyPairGeneratorSpec$Builder.setStartDate.

func (*KeyPairGeneratorSpecBuilder) SetSubject

func (m *KeyPairGeneratorSpecBuilder) SetSubject(arg0 *jni.Object) (*jni.Object, error)

SetSubject calls android.security.KeyPairGeneratorSpec$Builder.setSubject.

type KeyStoreException

type KeyStoreException struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyStoreException wraps android.security.KeyStoreException.

func (*KeyStoreException) GetNumericErrorCode

func (m *KeyStoreException) GetNumericErrorCode() (int32, error)

GetNumericErrorCode calls android.security.KeyStoreException.getNumericErrorCode.

func (*KeyStoreException) GetRetryPolicy

func (m *KeyStoreException) GetRetryPolicy() (int32, error)

GetRetryPolicy calls android.security.KeyStoreException.getRetryPolicy.

func (*KeyStoreException) IsSystemError

func (m *KeyStoreException) IsSystemError() (bool, error)

IsSystemError calls android.security.KeyStoreException.isSystemError.

func (*KeyStoreException) IsTransientFailure

func (m *KeyStoreException) IsTransientFailure() (bool, error)

IsTransientFailure calls android.security.KeyStoreException.isTransientFailure.

func (*KeyStoreException) RequiresUserAuthentication

func (m *KeyStoreException) RequiresUserAuthentication() (bool, error)

RequiresUserAuthentication calls android.security.KeyStoreException.requiresUserAuthentication.

func (*KeyStoreException) ToString

func (m *KeyStoreException) ToString() (string, error)

ToString calls android.security.KeyStoreException.toString.

type KeyStoreParameter

type KeyStoreParameter struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyStoreParameter wraps android.security.KeyStoreParameter.

func (*KeyStoreParameter) IsEncryptionRequired

func (m *KeyStoreParameter) IsEncryptionRequired() (bool, error)

IsEncryptionRequired calls android.security.KeyStoreParameter.isEncryptionRequired.

type KeyStoreParameterBuilder

type KeyStoreParameterBuilder struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

KeyStoreParameterBuilder wraps android.security.KeyStoreParameter$Builder.

func (*KeyStoreParameterBuilder) Build

func (m *KeyStoreParameterBuilder) Build() (*jni.Object, error)

Build calls android.security.KeyStoreParameter$Builder.build.

func (*KeyStoreParameterBuilder) SetEncryptionRequired

func (m *KeyStoreParameterBuilder) SetEncryptionRequired(arg0 bool) (*jni.Object, error)

SetEncryptionRequired calls android.security.KeyStoreParameter$Builder.setEncryptionRequired.

type NetworkSecurityPolicy

type NetworkSecurityPolicy struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

NetworkSecurityPolicy wraps android.security.NetworkSecurityPolicy.

func (*NetworkSecurityPolicy) GetInstance

func (m *NetworkSecurityPolicy) GetInstance() (*jni.Object, error)

GetInstance calls android.security.NetworkSecurityPolicy.getInstance.

func (*NetworkSecurityPolicy) IsCertificateTransparencyVerificationRequired

func (m *NetworkSecurityPolicy) IsCertificateTransparencyVerificationRequired(arg0 string) (bool, error)

IsCertificateTransparencyVerificationRequired calls android.security.NetworkSecurityPolicy.isCertificateTransparencyVerificationRequired.

func (*NetworkSecurityPolicy) IsCleartextTrafficPermitted0

func (m *NetworkSecurityPolicy) IsCleartextTrafficPermitted0() (bool, error)

IsCleartextTrafficPermitted0 calls android.security.NetworkSecurityPolicy.isCleartextTrafficPermitted.

func (*NetworkSecurityPolicy) IsCleartextTrafficPermitted1_1

func (m *NetworkSecurityPolicy) IsCleartextTrafficPermitted1_1(arg0 string) (bool, error)

IsCleartextTrafficPermitted1_1 calls android.security.NetworkSecurityPolicy.isCleartextTrafficPermitted.

Directories

Path Synopsis
Package advancedprotection provides Go bindings for android.security.advancedprotection.
Package advancedprotection provides Go bindings for android.security.advancedprotection.
Package identity provides Go bindings for android.security.identity.
Package identity provides Go bindings for android.security.identity.
Package keystore provides Go bindings for android.security.keystore.
Package keystore provides Go bindings for android.security.keystore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL