01: package org.bouncycastle.openpgp;
02:
03: import java.security.PrivateKey;
04:
05: /**
06: * general class to contain a private key for use with other openPGP
07: * objects.
08: */
09: public class PGPPrivateKey {
10: private long keyID;
11: private PrivateKey privateKey;
12:
13: /**
14: * Create a PGPPrivateKey from a regular private key and the keyID of its associated
15: * public key.
16: *
17: * @param privateKey private key tu use.
18: * @param keyID keyID of the corresponding public key.
19: */
20: public PGPPrivateKey(PrivateKey privateKey, long keyID) {
21: this .privateKey = privateKey;
22: this .keyID = keyID;
23: }
24:
25: /**
26: * Return the keyID associated with the contained private key.
27: *
28: * @return long
29: */
30: public long getKeyID() {
31: return keyID;
32: }
33:
34: /**
35: * Return the contained private key.
36: *
37: * @return PrivateKey
38: */
39: public PrivateKey getKey() {
40: return privateKey;
41: }
42: }
|