File Source: CertificateChainEntry.java
/*
P/P * Method: com.dmdirc.ui.core.dialogs.sslcertificate.CertificateChainEntry__static_init
*/
1 /*
2 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 */
22
23 package com.dmdirc.ui.core.dialogs.sslcertificate;
24
25 /**
26 * Represents one certificate within a chain.
27 *
28 * @since 0.6.3m1
29 * @author chris
30 */
31 public class CertificateChainEntry {
32
33 /** The common name of the certificate's subject. */
34 private final String name;
35
36 /** Whether or not this certificate is trusted. */
37 private final boolean trusted;
38
39 /** Whether or not there are problems with this certificate. */
40 private final boolean invalid;
41
42 /**
43 * Creates a new entry with the specified details.
44 *
45 * @param name The common name of the certificate's subject
46 * @param trusted Whether or not this certificate is trusted
47 * @param invalid Whether or not this certificate is invalid
48 */
49 public CertificateChainEntry(final String name, final boolean trusted,
50 final boolean invalid) {
/*
P/P * Method: void com.dmdirc.ui.core.dialogs.sslcertificate.CertificateChainEntry(String, bool, bool)
*
* Postconditions:
* this.invalid == invalid
* init'ed(this.invalid)
* this.name == name
* init'ed(this.name)
* this.trusted == trusted
* init'ed(this.trusted)
*/
51 super();
52 this.name = name;
53 this.trusted = trusted;
54 this.invalid = invalid;
55 }
56
57 /**
58 * Determines whether or not this certificate is invalid.
59 *
60 * @return True if the certificate is invalid, false otherwise
61 */
62 public boolean isInvalid() {
/*
P/P * Method: bool isInvalid()
*
* Postconditions:
* return_value == this.invalid
* init'ed(return_value)
*/
63 return invalid;
64 }
65
66 /**
67 * Determines whether or not this certificate is trusted.
68 *
69 * @return True if the certificate is from a trusted issuer, false otherwise
70 */
71 public boolean isTrusted() {
/*
P/P * Method: bool isTrusted()
*
* Postconditions:
* return_value == this.trusted
* init'ed(return_value)
*/
72 return trusted;
73 }
74
75 /**
76 * Retrieves the (common) name of this certificate.
77 *
78 * @return The name of this certificate
79 */
80 public String getName() {
/*
P/P * Method: String getName()
*
* Postconditions:
* return_value == this.name
* init'ed(return_value)
*/
81 return name;
82 }
83 }
SofCheck Inspector Build Version : 2.17854
| CertificateChainEntry.java |
2009-Jun-25 01:54:24 |
| CertificateChainEntry.class |
2009-Sep-02 17:04:13 |