Package br.net.woodstock.rockframework.security.sign

Examples of br.net.woodstock.rockframework.security.sign.SignerException


        signedData = CMSSignedData.replaceSigners(signedData, tmpSignerInformationStore);
      }

      return signedData.getEncoded();
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here


      if (content != null) {
        return this.verifyAttached(data, signature);
      }
      return this.verifyDetached(data, signature);
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

        }
      }

      return Collections.toArray(signatures, Signature.class);
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

    try {
      CMSSignedData signedData = new CMSSignedData(data);
      CMSProcessable processable = signedData.getSignedContent();
      return this.getContent(processable);
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

        currentData = writer.getBuffer().toString().getBytes();
      }
      return currentData;
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

          break;
        }
      }
      return valid;
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

  }

  @Override
  public byte[] sign(final byte[] data) {
    if (this.privateKey == null) {
      throw new SignerException("Private key is null");
    }
    try {
      Signature s = Signature.getInstance(this.signType.getAlgorithm());

      s.initSign(this.privateKey);
      s.update(data);

      byte[] bytes = s.sign();
      return bytes;
    } catch (NoSuchAlgorithmException e) {
      throw new SignerException(e);
    } catch (InvalidKeyException e) {
      throw new SignerException(e);
    } catch (SignatureException e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

  }

  @Override
  public boolean verify(final byte[] data, final byte[] signature) {
    if (this.publicKey == null) {
      throw new SignerException("Public key is null");
    }
    try {
      Signature s = Signature.getInstance(this.signType.getAlgorithm());

      s.initVerify(this.publicKey);
      s.update(data);

      boolean ok = s.verify(signature);
      return ok;
    } catch (NoSuchAlgorithmException e) {
      throw new SignerException(e);
    } catch (InvalidKeyException e) {
      throw new SignerException(e);
    } catch (SignatureException e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

      for (Identity identity : this.parameters.getIdentities()) {
        currentData = this.singleSign(data, identity);
      }
      return currentData;
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

      MakeSignature.signDetached(appearance, externalDigest, externalSignature, chain, null, ocsp, tsc, 0, CryptoStandard.CMS);

      return outputStream.toByteArray();
    } catch (Exception e) {
      throw new SignerException(e);
    }
  }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.security.sign.SignerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.