equal
deleted
inserted
replaced
133 */ |
133 */ |
134 @Override |
134 @Override |
135 public final boolean permits(Set<CryptoPrimitive> primitives, |
135 public final boolean permits(Set<CryptoPrimitive> primitives, |
136 String algorithm, Key key, AlgorithmParameters parameters) { |
136 String algorithm, Key key, AlgorithmParameters parameters) { |
137 |
137 |
138 if (algorithm == null || algorithm.length() == 0) { |
138 if (algorithm == null || algorithm.isEmpty()) { |
139 throw new IllegalArgumentException("No algorithm name specified"); |
139 throw new IllegalArgumentException("No algorithm name specified"); |
140 } |
140 } |
141 |
141 |
142 return checkConstraints(primitives, algorithm, key, parameters); |
142 return checkConstraints(primitives, algorithm, key, parameters); |
143 } |
143 } |
186 if (key == null) { |
186 if (key == null) { |
187 throw new IllegalArgumentException("The key cannot be null"); |
187 throw new IllegalArgumentException("The key cannot be null"); |
188 } |
188 } |
189 |
189 |
190 // check the signature algorithm with parameters |
190 // check the signature algorithm with parameters |
191 if (algorithm != null && algorithm.length() != 0) { |
191 if (algorithm != null && !algorithm.isEmpty()) { |
192 if (!permits(primitives, algorithm, parameters)) { |
192 if (!permits(primitives, algorithm, parameters)) { |
193 return false; |
193 return false; |
194 } |
194 } |
195 } |
195 } |
196 |
196 |