KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > security > CertificatePair


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.update.internal.security;
13  
14  import java.security.cert.*;
15  
16 /**
17  *
18  */

19 public class CertificatePair {
20     private Certificate root;
21     private Certificate issuer;
22     
23     
24
25     /**
26      * Gets the root.
27      * @return Returns a Certificate
28      */

29     public Certificate getRoot() {
30         return root;
31     }
32
33     /**
34      * Sets the root.
35      * @param root The root to set
36      */

37     public void setRoot(Certificate root) {
38         this.root = root;
39     }
40
41     /**
42      * Gets the issuer.
43      * @return Returns a Certificate
44      */

45     public Certificate getIssuer() {
46         return issuer;
47     }
48
49     /**
50      * Sets the issuer.
51      * @param issuer The issuer to set
52      */

53     public void setIssuer(Certificate issuer) {
54         this.issuer = issuer;
55     }
56
57     /*
58      * @see Object#equals(Object)
59      */

60     public boolean equals(Object JavaDoc obj) {
61         
62         if (obj==null) return false;
63         
64         if (!(obj instanceof CertificatePair)) return false;
65         
66         if (root==null || issuer==null) return false;
67         
68         CertificatePair pair = (CertificatePair)obj;
69         
70         return (root.equals(pair.getRoot()) && issuer.equals(pair.getIssuer()));
71     }
72
73 }
74
Popular Tags