Class EncryptionKey
java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,EncryptionKey>
com.aoindustries.aoserv.client.CachedObject<Integer,EncryptionKey>
com.aoindustries.aoserv.client.CachedObjectIntegerKey<EncryptionKey>
com.aoindustries.aoserv.client.pki.EncryptionKey
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
,SingleTableObject<Integer,
EncryptionKey>
Stores the list of encryption keys for a business. The keys themselves are GPG keys
and are stored by GPG.
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Constructor Summary
ConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionUses the private key to decrypt the data and verifies the signature.static String
Uses the provided private key to decrypt the data.encrypt
(EncryptionKey recipient, String plaintext) Encrypts a message for the provided recipient and signs with the private key.static String
Uses the provided public key to encrypt the data.protected Object
getColumnImpl
(int i) getId()
Gets the id of the key use for GPG.void
Initializes this object from the raw database contents.void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.CachedObjectIntegerKey
equals, getKey, getPkey, hashCode, toStringImpl
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
Methods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Constructor Details
-
EncryptionKey
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
encrypt
Uses the provided public key to encrypt the data.- Throws:
IOException
-
decrypt
public static String decrypt(String recipient, String ciphertext, String passphrase) throws IOException Uses the provided private key to decrypt the data.- Throws:
IOException
-
getAccount_name
-
getAccount
- Throws:
SQLException
IOException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
EncryptionKey>
-
getId
Gets the id of the key use for GPG. The id must be unique per business. -
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
EncryptionKey>
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
EncryptionKey> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
EncryptionKey> - Throws:
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
EncryptionKey> - Throws:
IOException
-
encrypt
Encrypts a message for the provided recipient and signs with the private key.- Throws:
IOException
-
decrypt
Uses the private key to decrypt the data and verifies the signature.- Throws:
IOException
-