Produced by Araxis Merge on 9/25/2018 2:13:05 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\org\apache\xml\internal\security\keys\keyresolver\implementations | SingleKeyResolver.java | Mon Jan 22 14:46:50 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\com\sun\org\apache\xml\internal\security\keys\keyresolver\implementations | SingleKeyResolver.java | Wed Sep 12 16:37:54 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 7 | 332 |
Changed | 6 | 12 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /* | |
2 | * reserve d comment block | |
3 | * DO NOT REMOVE OR ALTER! | |
4 | */ | |
5 | package co m.sun.org. apache.xml .internal. security.k eys.keyres olver.impl ementation s; | |
6 | ||
7 | import jav a.security .PrivateKe y; | |
8 | import jav a.security .PublicKey ; | |
9 | import jav a.security .cert.X509 Certificat e; | |
10 | import jav ax.crypto. SecretKey; | |
11 | import com .sun.org.a pache.xml. internal.s ecurity.ke ys.keyreso lver.KeyRe solverExce ption; | |
12 | import com .sun.org.a pache.xml. internal.s ecurity.ke ys.keyreso lver.KeyRe solverSpi; | |
13 | import com .sun.org.a pache.xml. internal.s ecurity.ke ys.storage .StorageRe solver; | |
14 | import com .sun.org.a pache.xml. internal.s ecurity.ut ils.Consta nts; | |
15 | import com .sun.org.a pache.xml. internal.s ecurity.ut ils.XMLUti ls; | |
16 | import org .w3c.dom.E lement; | |
17 | ||
18 | /** | |
19 | * Resolve s a single Key based on the Ke yName. | |
20 | */ | |
21 | public cla ss SingleK eyResolver extends K eyResolver Spi | |
22 | { | |
23 | /** {@ link org.a pache.comm ons.loggin g} logging facility */ | |
24 | privat e static j ava.util.l ogging.Log ger log = | |
25 | ja va.util.lo gging.Logg er.getLogg er(SingleK eyResolver .class.get Name()); | |
26 | ||
27 | privat e String k eyName; | |
28 | privat e PublicKe y publicKe y; | |
29 | privat e PrivateK ey private Key; | |
30 | private Se cretKey PW Key; | |
31 | ||
32 | /** | |
33 | * Con structor. | |
34 | * @pa ram keyNam e | |
35 | * @pa ram public Key | |
36 | */ | |
37 | public SingleKey Resolver(S tring keyN ame, Publi cKey publi cKey) { | |
38 | th is.keyName = keyName ; | |
39 | th is.publicK ey = publi cKey; | |
40 | } | |
41 | ||
42 | /** | |
43 | * Con structor. | |
44 | * @pa ram keyNam e | |
45 | * @pa ram privat eKey | |
46 | */ | |
47 | public SingleKey Resolver(S tring keyN ame, Priva teKey priv ateKey) { | |
48 | th is.keyName = keyName ; | |
49 | th is.private Key = priv ateKey; | |
50 | } | |
51 | ||
52 | /** | |
53 | * Con structor. | |
54 | * @pa ram keyNam e | |
55 | * @param PW Key | |
56 | */ | |
57 | public Sin gleKeyReso lver(Strin g keyName, SecretKey PW Key) { | |
58 | th is.keyName = keyName ; | |
59 | this. PW Key = PW Key; | |
60 | } | |
61 | ||
62 | /** | |
63 | * Thi s method r eturns whe ther the K eyResolver Spi is abl e to perfo rm the req uested act ion. | |
64 | * | |
65 | * @pa ram elemen t | |
66 | * @pa ram BaseUR I | |
67 | * @pa ram storag e | |
68 | * @re turn wheth er the Key ResolverSp i is able to perform the reque sted actio n. | |
69 | */ | |
70 | public boolean e ngineCanRe solve(Elem ent elemen t, String baseURI, S torageReso lver stora ge) { | |
71 | re turn XMLUt ils.elemen tIsInSigna tureSpace( element, C onstants._ TAG_KEYNAM E); | |
72 | } | |
73 | ||
74 | /** | |
75 | * Met hod engine LookupAndR esolvePubl icKey | |
76 | * | |
77 | * @pa ram elemen t | |
78 | * @pa ram baseUR I | |
79 | * @pa ram storag e | |
80 | * @re turn null if no {@li nk PublicK ey} could be obtaine d | |
81 | * @th rows KeyRe solverExce ption | |
82 | */ | |
83 | public PublicKey engineLoo kupAndReso lvePublicK ey( | |
84 | El ement elem ent, Strin g baseURI, StorageRe solver sto rage | |
85 | ) thro ws KeyReso lverExcept ion { | |
86 | if (log.isLo ggable(jav a.util.log ging.Level .FINE)) { | |
87 | log.log( java.util. logging.Le vel.FINE, "Can I res olve " + e lement.get TagName() + "?"); | |
88 | } | |
89 | ||
90 | if (publicKe y != null | |
91 | && XMLUt ils.elemen tIsInSigna tureSpace( element, C onstants._ TAG_KEYNAM E)) { | |
92 | String n ame = elem ent.getFir stChild(). getNodeVal ue(); | |
93 | if (keyN ame.equals (name)) { | |
94 | retu rn publicK ey; | |
95 | } | |
96 | } | |
97 | ||
98 | lo g.log(java .util.logg ing.Level. FINE, "I c an't"); | |
99 | re turn null; | |
100 | } | |
101 | ||
102 | /** | |
103 | * Met hod engine ResolveX50 9Certifica te | |
104 | * @in heritDoc | |
105 | * @pa ram elemen t | |
106 | * @pa ram baseUR I | |
107 | * @pa ram storag e | |
108 | * @th rows KeyRe solverExce ption | |
109 | */ | |
110 | public X509Certi ficate eng ineLookupR esolveX509 Certificat e( | |
111 | El ement elem ent, Strin g baseURI, StorageRe solver sto rage | |
112 | ) thro ws KeyReso lverExcept ion { | |
113 | re turn null; | |
114 | } | |
115 | ||
116 | /** | |
117 | * Met hod engine ResolveSec retKey | |
118 | * | |
119 | * @pa ram elemen t | |
120 | * @pa ram baseUR I | |
121 | * @pa ram storag e | |
122 | * @re turn resol ved Secret Key key or null if n o {@link S ecretKey} could be o btained | |
123 | * | |
124 | * @th rows KeyRe solverExce ption | |
125 | */ | |
126 | public SecretKey engineRes olveSecret Key( | |
127 | El ement elem ent, Strin g baseURI, StorageRe solver sto rage | |
128 | ) thro ws KeyReso lverExcept ion { | |
129 | if (log.isLo ggable(jav a.util.log ging.Level .FINE)) { | |
130 | log.log( java.util. logging.Le vel.FINE, "Can I res olve " + e lement.get TagName() + "?"); | |
131 | } | |
132 | ||
133 | if ( PW Key != nul l | |
134 | && XMLUt ils.elemen tIsInSigna tureSpace( element, C onstants._ TAG_KEYNAM E)) { | |
135 | String n ame = elem ent.getFir stChild(). getNodeVal ue(); | |
136 | if (keyN ame.equals (name)) { | |
137 | return PW Key; | |
138 | } | |
139 | } | |
140 | ||
141 | lo g.log(java .util.logg ing.Level. FINE, "I c an't"); | |
142 | re turn null; | |
143 | } | |
144 | ||
145 | /** | |
146 | * Met hod engine ResolvePri vateKey | |
147 | * @in heritDoc | |
148 | * @pa ram elemen t | |
149 | * @pa ram baseUR I | |
150 | * @pa ram storag e | |
151 | * @re turn resol ved Privat eKey key o r null if no {@link PrivateKey } could be obtained | |
152 | * @th rows KeyRe solverExce ption | |
153 | */ | |
154 | public PrivateKe y engineLo okupAndRes olvePrivat eKey( | |
155 | El ement elem ent, Strin g baseURI, StorageRe solver sto rage | |
156 | ) thro ws KeyReso lverExcept ion { | |
157 | if (log.isLo ggable(jav a.util.log ging.Level .FINE)) { | |
158 | log.log( java.util. logging.Le vel.FINE, "Can I res olve " + e lement.get TagName() + "?"); | |
159 | } | |
160 | ||
161 | if (privateK ey != null | |
162 | && XMLUt ils.elemen tIsInSigna tureSpace( element, C onstants._ TAG_KEYNAM E)) { | |
163 | String n ame = elem ent.getFir stChild(). getNodeVal ue(); | |
164 | if (keyN ame.equals (name)) { | |
165 | retu rn private Key; | |
166 | } | |
167 | } | |
168 | ||
169 | lo g.log(java .util.logg ing.Level. FINE, "I c an't"); | |
170 | re turn null; | |
171 | } | |
172 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.