Since: API Level 1
package

java.security

This package provides all the classes and interfaces that constitute the Java security framework. The content of this package can be divided into two parts:

  • Classes implementing the access control infrastructure.

    The central class is java.security.AccessController which checks if code, invoking sensitive resources, was granted the required permissions.

    The class loader (java.security.SecureClassLoader) associates classes with a protection domain (java.security.ProtectionDomain) which consists of a code source (java.security.CodeSource) and the granted permissions (java.security.Permission). The policy, defined through java.security.Policy, defines which permissions are granted to classes loaded from a code source ( class java.security.CodeSource).

  • Classes and interfaces for the extensible cryptographic service provider infrastructure (SPI) such as abstractions for certificates, signatures, private and public keys. Also abstractions for the algorithms they utilize are provided in this package.

    Security providers, as defined in java.security.Providers, can be registered to provide different implementations for a variety of security infrastructure, such as key stores. Therefore the corresponding service provider interface (i.e. java.security.KeyStoreSpi) must be implemented.

Interfaces

Certificate This interface is deprecated. Replaced by behavior in java.security.cert 
DomainCombiner DomainCombiner is used to update and optimize ProtectionDomains from an AccessControlContext
Guard Guard implementors protect access to other objects. 
Key Key is the common interface for all keys. 
KeyStore.Entry Entry is the common marker interface for a KeyStore entry. 
KeyStore.LoadStoreParameter LoadStoreParameter represents a parameter that specifies how a KeyStore can be loaded and stored. 
KeyStore.ProtectionParameter ProtectionParameter is a marker interface for protection parameters. 
Policy.Parameters A marker interface for Policy parameters. 
Principal Principals are objects which have identities. 
PrivateKey PrivateKey is the common interface for private keys. 
PrivilegedAction<T> PrivilegedAction represents an action that can be executed privileged regarding access control. 
PrivilegedExceptionAction<T> PrivilegedAction represents an action, that can be executed privileged regarding access control. 
PublicKey PublicKey is the common interface for public keys. 

Classes

AccessControlContext AccessControlContext encapsulates the ProtectionDomains on which access control decisions are based. 
AccessController AccessController provides static methods to perform access control checks and privileged operations. 
AlgorithmParameterGenerator AlgorithmParameterGenerator is an engine class which is capable of generating parameters for the algorithm it was initialized with. 
AlgorithmParameterGeneratorSpi AlgorithmParameterGeneratorSpi is the Service Provider Interface (SPI) definition for AlgorithmParameterGenerator
AlgorithmParameters AlgorithmParameters is an engine class which provides algorithm parameters. 
AlgorithmParametersSpi AlgorithmParametersSpi is the Service Provider Interface (SPI) definition for AlgorithmParameters
AllPermission AllPermission represents the permission to perform any operation. 
AuthProvider AuthProvider is an abstract superclass for Java Security Provider which provide login and logout. 
BasicPermission BasicPermission is the common base class of all permissions which have a name but no action lists. 
CodeSigner CodeSigner represents a signer of code. 
CodeSource CodeSource encapsulates the location from where code is loaded and the certificates that were used to verify that code. 
DigestInputStream DigestInputStream is a FilterInputStream which maintains an associated message digest. 
DigestOutputStream DigestOutputStream is a FilterOutputStream which maintains an associated message digest. 
GuardedObject GuardedObject controls access to an object, by checking all requests for the object with a Guard
Identity This class is deprecated. The functionality of this class has been replace by Principal, KeyStore and the java.security.cert package.  
IdentityScope This class is deprecated. The functionality of this class has been replace by Principal, KeyStore and the java.security.cert package.  
KeyFactory KeyFactory is an engine class that can be used to translate between public and private key objects and convert keys between their external representation, that can be easily transported and their internal representation. 
KeyFactorySpi KeyFactorySpi is the Service Provider Interface (SPI) definition for KeyFactory
KeyPair KeyPair is a container for a public key and a private key. 
KeyPairGenerator KeyPairGenerator is an engine class which is capable of generating a private key and its related public key utilizing the algorithm it was initialized with. 
KeyPairGeneratorSpi KeyPairGeneratorSpi is the Service Provider Interface (SPI) definition for KeyPairGenerator
KeyRep KeyRep is a standardized representation for serialized Key objects. 
KeyStore KeyStore is responsible for maintaining cryptographic keys and their owners. 
KeyStore.Builder Builder is used to construct new instances of KeyStore
KeyStore.CallbackHandlerProtection CallbackHandlerProtection is a ProtectionParameter that encapsulates a CallbackHandler
KeyStore.PasswordProtection PasswordProtection is a ProtectionParameter that protects a KeyStore using a password. 
KeyStore.PrivateKeyEntry PrivateKeyEntry represents a KeyStore entry that holds a private key. 
KeyStore.SecretKeyEntry SecretKeyEntry represents a KeyStore entry that holds a secret key. 
KeyStore.TrustedCertificateEntry TrustedCertificateEntry represents a KeyStore entry that holds a trusted certificate. 
KeyStoreSpi KeyStoreSpi is the Service Provider Interface (SPI) definition for KeyStore
MessageDigest Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence. 
MessageDigestSpi MessageDigestSpi is the Service Provider Interface (SPI) definition for MessageDigest
Permission Permission is the common base class of all permissions that participate in the access control security framework around AccessController and AccessControlContext
PermissionCollection PermissionCollection is the common base class for all collections that provide a convenient method for determining whether or not a given permission is implied by any of the permissions present in this collection. 
Permissions Permissions represents a PermissionCollection where the contained permissions can be of different types. 
Policy Policy is the common super type of classes which represent a system security policy. 
PolicySpi Represents the Service Provider Interface (SPI) for java.security.Policy class. 
ProtectionDomain ProtectionDomain represents all permissions that are granted to a specific code source. 
Provider Provider is the abstract superclass for all security providers in the Java security infrastructure. 
Provider.Service Service represents a service in the Java Security infrastructure. 
SecureClassLoader SecureClassLoader represents a ClassLoader which associates the classes it loads with a code source and provide mechanisms to allow the relevant permissions to be retrieved. 
SecureRandom This class generates cryptographically secure pseudo-random numbers. 
SecureRandomSpi SecureRandomSpi is the Service Provider Interface (SPI) definition for SecureRandom
Security Security is the central class in the Java Security API. 
SecurityPermission SecurityPermission objects guard access to the mechanisms which implement security. 
Signature Signature is an engine class which is capable of creating and verifying digital signatures, using different algorithms that have been registered with the Security class. 
SignatureSpi SignatureSpi is the Service Provider Interface (SPI) definition for Signature
SignedObject A SignedObject instance acts as a container for another object. 
Signer This class is deprecated. Replaced by behavior in java.security.cert package and Principal  
Timestamp Timestamp represents a signed time stamp. 
UnresolvedPermission An UnresolvedPermission represents a Permission whose type should be resolved lazy and not during initialization time of the Policy

Enums

KeyRep.Type Type enumerates the supported key types. 

Exceptions

AccessControlException AccessControlException is thrown if the access control infrastructure denies protected access due to missing permissions. 
DigestException DigestException is a general message digest exception. 
GeneralSecurityException GeneralSecurityException is a general security exception and the superclass for all security specific exceptions. 
InvalidAlgorithmParameterException InvalidAlgorithmParameterException indicates the occurrence of invalid algorithm parameters. 
InvalidKeyException InvalidKeyException indicates exceptional conditions, caused by an invalid key. 
InvalidParameterException InvalidParameterException indicates exceptional conditions, caused by invalid parameters. 
KeyException KeyException is the common superclass of all key related exceptions. 
KeyManagementException KeyManagementException is a general exception, thrown to indicate an exception during processing an operation concerning key management. 
KeyStoreException KeyStoreException is a general KeyStore exception. 
NoSuchAlgorithmException NoSuchAlgorithmException indicates that a requested algorithm could not be found. 
NoSuchProviderException NoSuchProviderException indicates that a requested security provider could not be found. 
PrivilegedActionException PrivilegedActionException wraps exceptions which are thrown from within privileged operations. 
ProviderException ProviderException is a general exception, thrown by security Providers
SignatureException SignatureException is a general Signature exception. 
UnrecoverableEntryException UnrecoverableEntryException indicates, that a KeyStore.Entry cannot be recovered from a KeyStore
UnrecoverableKeyException UnrecoverableKeyException indicates, that a key cannot be recovered from a KeyStore