File tree 3 files changed +39
-19
lines changed
src/main/java/org/jruby/ext/openssl/x509store
3 files changed +39
-19
lines changed Original file line number Diff line number Diff line change 36
36
*/
37
37
public class CRL extends X509Object {
38
38
39
- public java .security .cert .CRL crl ;
39
+ public /* final */ java .security .cert .CRL crl ;
40
+
41
+ @ Deprecated // not-used
42
+ public CRL () { /* */ }
43
+
44
+ public CRL (X509CRL crl ) {
45
+ this .crl = crl ;
46
+ }
40
47
41
48
@ Override
42
49
public int type () {
@@ -45,22 +52,24 @@ public int type() {
45
52
46
53
@ Override
47
54
public boolean isName (final Name name ) {
48
- return name .equalTo ( ((X509CRL ) this . crl ).getIssuerX500Principal () );
55
+ return name .equalTo ( ((X509CRL ) crl ).getIssuerX500Principal () );
49
56
}
50
57
51
58
@ Override
52
59
public boolean matches (final X509Object other ) {
53
- return other instanceof CRL &&
54
- ((X509CRL ) crl ).getIssuerX500Principal ().equals ( ((X509CRL )((CRL ) other ).crl ).getIssuerX500Principal () );
60
+ if (other instanceof CRL ) {
61
+ final X509CRL thisCRL = (X509CRL ) crl ;
62
+ final X509CRL thatCRL = (X509CRL )((CRL ) other ).crl ;
63
+ return thisCRL .getIssuerX500Principal ().equals ( thatCRL .getIssuerX500Principal () );
64
+ }
65
+ return false ;
55
66
}
56
67
57
68
@ Override
58
- public int compareTo (X509Object oth ) {
59
- int ret = super .compareTo (oth );
60
- if (ret == 0 ) {
61
- ret = crl .equals ( ((CRL ) oth ).crl ) ? 0 : -1 ;
62
- }
63
- return ret ;
69
+ public int compareTo (final X509Object other ) {
70
+ int cmp = super .compareTo (other );
71
+ if (cmp != 0 ) return cmp ;
72
+ return crl .equals ( ((CRL ) other ).crl ) ? 0 : -1 ;
64
73
}
65
74
66
75
}// X509_OBJECT_CRL
Original file line number Diff line number Diff line change @@ -52,17 +52,18 @@ public boolean isName(final Name name) {
52
52
53
53
@ Override
54
54
public boolean matches (final X509Object other ) {
55
- return other instanceof Certificate &&
56
- x509 .getSubjectX500Principal ().equals ( ((Certificate ) other ).x509 .getSubjectX500Principal () );
55
+ if (other instanceof Certificate ) {
56
+ final Certificate that = (Certificate ) other ;
57
+ return this .x509 .getSubjectX500Principal ().equals ( that .x509 .getSubjectX500Principal () );
58
+ }
59
+ return false ;
57
60
}
58
61
59
62
@ Override
60
63
public int compareTo (final X509Object other ) {
61
- int ret = super .compareTo (other );
62
- if (ret == 0 ) {
63
- ret = x509 .equals ( ( (Certificate ) other ).x509 ) ? 0 : -1 ;
64
- }
65
- return ret ;
64
+ int cmp = super .compareTo (other );
65
+ if (cmp != 0 ) return cmp ;
66
+ return x509 .equals ( ( (Certificate ) other ).x509 ) ? 0 : -1 ;
66
67
}
67
68
68
69
}// X509_OBJECT_CERT
Original file line number Diff line number Diff line change 12
12
* rights and limitations under the License.
13
13
*
14
14
* Copyright (C) 2006 Ola Bini <ola@ologix.com>
15
- *
15
+ *
16
16
* Alternatively, the contents of this file may be used under the terms of
17
17
* either of the GNU General Public License Version 2 or later (the "GPL"),
18
18
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
27
***** END LICENSE BLOCK *****/
28
28
package org .jruby .ext .openssl .x509store ;
29
29
30
+ import java .security .PrivateKey ;
31
+
30
32
/**
31
33
* c: X509_OBJECT
32
34
*
33
35
* @author <a href="mailto:ola.bini@ki.se">Ola Bini</a>
34
36
*/
35
37
public class PKey extends X509Object {
36
- public java .security .PrivateKey pkey ;
38
+
39
+ public /* final */ java .security .PrivateKey pkey ;
40
+
41
+ @ Deprecated // not-used
42
+ public PKey () { /* no-op */ }
43
+
44
+ public PKey (PrivateKey pkey ) {
45
+ this .pkey = pkey ;
46
+ }
37
47
38
48
public int type () {
39
49
return X509Utils .X509_LU_PKEY ;
You can’t perform that action at this time.
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy
0 commit comments