61 * @author Hemma Prafullchandra |
61 * @author Hemma Prafullchandra |
62 */ |
62 */ |
63 public class AlgorithmId implements Serializable, DerEncoder { |
63 public class AlgorithmId implements Serializable, DerEncoder { |
64 |
64 |
65 /** use serialVersionUID from JDK 1.1. for interoperability */ |
65 /** use serialVersionUID from JDK 1.1. for interoperability */ |
|
66 @java.io.Serial |
66 private static final long serialVersionUID = 7205873507486557157L; |
67 private static final long serialVersionUID = 7205873507486557157L; |
67 |
68 |
68 /** |
69 /** |
69 * The object identitifer being used for this algorithm. |
70 * The object identitifer being used for this algorithm. |
70 */ |
71 */ |
71 private ObjectIdentifier algid; |
72 private ObjectIdentifier algid; |
72 |
73 |
73 // The (parsed) parameters |
74 // The (parsed) parameters |
|
75 @SuppressWarnings("serial") // Not statically typed as Serializable |
74 private AlgorithmParameters algParams; |
76 private AlgorithmParameters algParams; |
75 private boolean constructedFromDer = true; |
77 private boolean constructedFromDer = true; |
76 |
78 |
77 /** |
79 /** |
78 * Parameters for this algorithm. These are stored in unparsed |
80 * Parameters for this algorithm. These are stored in unparsed |
79 * DER-encoded form; subclasses can be made to automaticaly parse |
81 * DER-encoded form; subclasses can be made to automaticaly parse |
80 * them so there is fast access to these parameters. |
82 * them so there is fast access to these parameters. |
81 */ |
83 */ |
|
84 @SuppressWarnings("serial") // Not statically typed as Serializable |
82 protected DerValue params; |
85 protected DerValue params; |
83 |
86 |
84 |
87 |
85 /** |
88 /** |
86 * Constructs an algorithm ID which will be initialized |
89 * Constructs an algorithm ID which will be initialized |
272 /** |
275 /** |
273 * Returns true iff the argument indicates the same algorithm |
276 * Returns true iff the argument indicates the same algorithm |
274 * with the same parameters. |
277 * with the same parameters. |
275 */ |
278 */ |
276 public boolean equals(AlgorithmId other) { |
279 public boolean equals(AlgorithmId other) { |
277 boolean paramsEqual = |
280 boolean paramsEqual = Objects.equals(other.params, params); |
278 (params == null ? other.params == null : params.equals(other.params)); |
|
279 return (algid.equals((Object)other.algid) && paramsEqual); |
281 return (algid.equals((Object)other.algid) && paramsEqual); |
280 } |
282 } |
281 |
283 |
282 /** |
284 /** |
283 * Compares this AlgorithmID to another. If algorithm parameters are |
285 * Compares this AlgorithmID to another. If algorithm parameters are |