APIdia Launch Partner
Top Description Fields Constructors Methods
java.security

public abstract Class Signer

extends Identity
Class Inheritance
Annotations
@Deprecated
since:1.2
forRemoval:true
@SuppressWarnings:removal
Imports
java.io.*

Deprecated

for removal since 1.2.

This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by java.security.KeyStore, the java.security.cert package, and java.security.Principal.

This class is used to represent an Identity that can also digitally sign data.

The management of a signer's private keys is an important and sensitive issue that should be handled by subclasses as appropriate to their intended use.

Author
Benjamin Renaud
Since
1.1
See Also
Identity

Field Summary

Modifier and TypeField and Description
private PrivateKey
privateKey

The signer's private key.

private static final long
Inherited from java.security.Identity:
certificatesinfoscope

Constructor Summary

AccessConstructor and Description
protected
Signer()

Creates a Signer.

public
Signer(String
the identity name.
name
)

Creates a Signer with the specified identity name.

public
Signer(String
the identity name.
name
,
IdentityScope
the scope of the identity.
scope
)
References Deprecated IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

Creates a Signer with the specified identity name and scope.

Method Summary

Modifier and TypeMethod and Description
public PrivateKey

Returns:

this signer's private key, or null if the private key has not yet been set.
getPrivateKey
()

Returns this signer's private key.

pack-priv String
public final void
setKeyPair(KeyPair
an initialized key pair.
pair
)

Sets the key pair (public key and private key) for this Signer.

public String

Returns:

a string of information about the Signer.
toString
()

Overrides java.security.Identity.toString.

Implements java.security.Principal.toString.

Returns a string of information about the Signer.

Inherited from java.security.Identity:
addCertificatecertificatesequalsfullNamegetInfogetNamegetPublicKeygetScopehashCodeidentityEqualsprintCertificatesremoveCertificatesetInfosetPublicKeytoString

Field Detail

privateKeyback to summary
private PrivateKey privateKey

The signer's private key.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.Identity.serialVersionUID.

Annotations
@Serial

Constructor Detail

Signerback to summary
protected Signer()

Creates a Signer. This constructor should only be used for serialization.

Signerback to summary
public Signer(String name)

Creates a Signer with the specified identity name.

Parameters
name:String

the identity name.

Signerback to summary
public Signer(String name, IdentityScope scope) throws KeyManagementException

References Deprecated

IdentityScope is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Creates a Signer with the specified identity name and scope.

Parameters
name:String

the identity name.

scope:IdentityScope

the scope of the identity.

Exceptions
KeyManagementException:
if there is already an identity with the same name in the scope.

Method Detail

getPrivateKeyback to summary
public PrivateKey getPrivateKey()

Returns this signer's private key.

Returns:PrivateKey

this signer's private key, or null if the private key has not yet been set.

printKeysback to summary
pack-priv String printKeys()

Overrides java.security.Identity.printKeys.

setKeyPairback to summary
public final void setKeyPair(KeyPair pair) throws InvalidParameterException, KeyException

Sets the key pair (public key and private key) for this Signer.

Parameters
pair:KeyPair

an initialized key pair.

Exceptions
InvalidParameterException:
if the key pair is not properly initialized.
KeyException:
if the key pair cannot be set for any other reason.
toStringback to summary
public String toString()

Overrides java.security.Identity.toString.

Implements java.security.Principal.toString.

Returns a string of information about the Signer.

Returns:String

a string of information about the Signer.