java.security.SignatureException#getMessage ( )源码实例Demo

下面列出了java.security.SignatureException#getMessage ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: gsc-core   文件: BlockWrapper.java
public boolean validateSignature(Manager dbManager) throws ValidateSignatureException {
    try {
        byte[] sigAddress = ECKey.signatureToAddress(getRawHash().getBytes(),
                TransactionWrapper.getBase64FromByteString(block.getBlockHeader().getWitnessSignature()));
        byte[] witnessAccountAddress = block.getBlockHeader().getRawData().getWitnessAddress()
                .toByteArray();

        if (dbManager.getDynamicPropertiesStore().getAllowMultiSign() != 1) {
            return Arrays.equals(sigAddress, witnessAccountAddress);
        } else {
            byte[] witnessPermissionAddress = dbManager.getAccountStore().get(witnessAccountAddress)
                    .getWitnessPermissionAddress();
            return Arrays.equals(sigAddress, witnessPermissionAddress);
        }

    } catch (SignatureException e) {
        throw new ValidateSignatureException(e.getMessage());
    }
}
 
源代码2 项目: j2objc   文件: SignatureExceptionTest.java
/**
 * Test for <code>SignatureException(Throwable)</code> constructor
 * Assertion: constructs SignatureException when <code>cause</code> is not
 * null
 */
public void testSignatureException05() {
    SignatureException tE = new SignatureException(tCause);
    if (tE.getMessage() != null) {
        String toS = tCause.toString();
        String getM = tE.getMessage();
        assertTrue("getMessage() should contain ".concat(toS), (getM
                .indexOf(toS) != -1));
    }
    assertNotNull("getCause() must not return null", tE.getCause());
    assertEquals("getCause() must return ".concat(tCause.toString()), tE
            .getCause(), tCause);
}
 
源代码3 项目: j2objc   文件: SignatureExceptionTest.java
/**
 * Test for <code>SignatureException(String, Throwable)</code> constructor
 * Assertion: constructs SignatureException when <code>cause</code> is not
 * null <code>msg</code> is null
 */
public void testSignatureException08() {
    SignatureException tE = new SignatureException(null, tCause);
    if (tE.getMessage() != null) {
        String toS = tCause.toString();
        String getM = tE.getMessage();
        assertTrue("getMessage() must should ".concat(toS), (getM
                .indexOf(toS) != -1));
    }
    assertNotNull("getCause() must not return null", tE.getCause());
    assertEquals("getCause() must return ".concat(tCause.toString()), tE
            .getCause(), tCause);
}
 
源代码4 项目: xipki   文件: SignatureSigner.java
@Override
public void write(int singleByte) throws IOException {
  try {
    signer.update((byte) singleByte);
  } catch (SignatureException ex) {
    throw new IOException(ex.getMessage(), ex);
  }
}
 
源代码5 项目: xipki   文件: SignatureSigner.java
@Override
public void write(byte[] bytes) throws IOException {
  try {
    signer.update(bytes);
  } catch (SignatureException ex) {
    throw new IOException(ex.getMessage(), ex);
  }
}
 
源代码6 项目: xipki   文件: SignatureSigner.java
@Override
public void write(byte[] bytes, int off, int len) throws IOException {
  try {
    signer.update(bytes, off, len);
  } catch (SignatureException ex) {
    throw new IOException(ex.getMessage(), ex);
  }
}
 
源代码7 项目: xipki   文件: SignatureSigner.java
@Override
public byte[] getSignature() {
  try {
    return stream.getSignature();
  } catch (SignatureException ex) {
    throw new RuntimeOperatorException("exception obtaining signature: " + ex.getMessage(), ex);
  }
}