List of usage examples for java.security Signature equals
public boolean equals(Object obj)
From source file:org.eclipse.licensing.base.LicenseKey.java
public boolean isAuthentic(PublicKey publicKey) { try {/*from w w w . ja va 2s . c o m*/ Signature signature = Signature.getInstance("SHA1withDSA", "SUN"); signature.initVerify(publicKey); String[] propKeys = properties.keySet().toArray(new String[0]); Arrays.sort(propKeys); for (String propKey : propKeys) { if (!SIGNATURE.equals(propKey)) { String propValue = getProperty(propKey); signature.update(propValue.getBytes("UTF-8")); } } byte[] encodedSignature = getSignature(); if (encodedSignature == null) { return false; } return signature.verify(getSignature()); } catch (GeneralSecurityException | UnsupportedEncodingException e) { e.printStackTrace(); return false; } }