Added in API level 1
Deprecated in API level 3

Signer

abstract class Signer : Identity
kotlin.Any
   ↳ java.security.Identity
   ↳ java.security.Signer

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.

Summary

Public constructors
Signer(name: String!)

Creates a signer with the specified identity name.

Signer(name: String!, scope: IdentityScope!)

Creates a signer with the specified identity name and scope.

Protected constructors

Creates a signer.

Public methods
open PrivateKey!

Returns this signer's private key.

Unit

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

open String

Returns a string of information about the signer.

Inherited functions

Public constructors

Signer

Added in API level 1
Signer(name: String!)

Creates a signer with the specified identity name.

Parameters
name String!: the identity name.

Signer

Added in API level 1
Signer(
    name: String!,
    scope: IdentityScope!)

Creates a signer with the specified identity name and scope.

Parameters
name String!: the identity name.
scope IdentityScope!: the scope of the identity.
Exceptions
java.security.KeyManagementException if there is already an identity with the same name in the scope.

Protected constructors

Signer

Added in API level 1
protected Signer()

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

Public methods

getPrivateKey

Added in API level 1
open fun getPrivateKey(): PrivateKey!

Deprecated: Deprecated in Java.

Returns this signer's private key.

First, if there is a security manager, its checkSecurityAccess method is called with "getSignerPrivateKey" as its argument to see if it's ok to return the private key.

Return
PrivateKey! this signer's private key, or null if the private key has not yet been set.
Exceptions
java.lang.SecurityException if a security manager exists and its checkSecurityAccess method doesn't allow returning the private key.

setKeyPair

Added in API level 1
fun setKeyPair(pair: KeyPair!): Unit

Deprecated: Deprecated in Java.

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

First, if there is a security manager, its checkSecurityAccess method is called with "setSignerKeyPair" as its argument to see if it's ok to set the key pair.

Parameters
pair KeyPair!: an initialized key pair.
Exceptions
java.security.InvalidParameterException if the key pair is not properly initialized.
java.security.KeyException if the key pair cannot be set for any other reason.
java.lang.SecurityException if a security manager exists and its checkSecurityAccess method doesn't allow setting the key pair.

toString

Added in API level 1
open fun toString(): String

Deprecated: Deprecated in Java.

Returns a string of information about the signer.

Return
String a string of information about the signer.