Coverage details for base.jdbs.cryptography.asymmetric.KeyPair

LineHitsSource
1 /*******************************************************************************
2  *InternetCafe is a software solution that helps the management of Cybercafes
3  * according with the ITALIAN DECREE LAW ON ANTI-TERROR MEASURES, 27 JULY 2005.
4  * Copyright (C) 2006 Guido Angelo Ingenito
5  
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *******************************************************************************/
20 package base.jdbs.cryptography.asymmetric;
21  
22 import java.security.cert.X509Certificate;
23  
24 import org.apache.log4j.Logger;
25  
260public class KeyPair {
27  
280    private static final transient Logger logger = Logger.getLogger(KeyPair.class.getName());
29  
30     /**The keypairs' identifier.**/
31     private final Integer id;
32     /**The asymmetric public key associated to the keypair.**/
33     private final PublicKey publicKey;
34     /**The asymmetric private key associated to the keypair.**/
35     private final PrivateKey privateKey;
36     /**The keypairs' certificate**/
37     private final X509Certificate certificate;
38     /**The keypairs' name.**/
39     private final String name;
40     
41     /**
42      * @param id The unique keypair's identifier.
43      * @param name The keypairs' name.
44      * @param publicKey The keypairs'public key.
45      * @param privateKey The keypairs' private key.
46      * @param certificate The keypairs' certificate.
47      */
480    public KeyPair(Integer id, String name, PublicKey publicKey, PrivateKey privateKey, X509Certificate certificate) {
490        this.id = id;
500        this.name = name;
510        this.publicKey = publicKey;
520        this.privateKey = privateKey;
530        this.certificate = certificate;
540    }
550    
56     /**
57      * @return Returns the id.
58      */
59     public Integer getId() {
600        return id;
610    }
62  
63     /**
64      * @return Returns the privateKey.
65      */
66     public PrivateKey getPrivateKey() {
670        return privateKey;
680    }
69  
70     /**
71      * @return Returns the publicKey.
72      */
73     public PublicKey getPublicKey() {
740        return publicKey;
750    }
76  
77     /**
78      * @return Returns the name.
79      */
80     public String getName() {
810        return name;
820    }
83     
84     /**
85      * This method builds an alias for the keypair instance.
86      * @return The alias associated to the keypair instance.
87      */
88     public String alias(){
890        return this.id + " " + this.name;
900    }
91  
92     /**
93      * @return Returns the certificate.
94      */
95     public X509Certificate getCertificate() {
960        return certificate;
970    }
98 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.