Examples of KeyStoreConfig


Examples of org.jboss.seam.pdf.KeyStoreConfig

        }  
        return null;
    }   

    public byte[] sign(byte[] originalBytes) {
        KeyStoreConfig store = KeyStoreConfig.instance();
       
        try {                       
            InputStream is = FacesResources.getResourceAsStream( store.getKeyStore(), getFacesContext().getExternalContext() );
           
            KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
            ks.load(is, store.getKeyStorePassword().toCharArray());

            PrivateKey key = (PrivateKey) ks.getKey(store.getKeyAlias(),
                        store.getKeyPassword().toCharArray());
            Certificate[] chain =  ks.getCertificateChain(store.getKeyAlias());

            PdfReader reader = new PdfReader(originalBytes);
            ByteArrayOutputStream os = new ByteArrayOutputStream();                

            PdfStamper stamper = PdfStamper.createSignature(reader, os, '\0');
View Full Code Here

Examples of org.jboss.seam.pdf.KeyStoreConfig

        }  
        return null;
    }   

    public byte[] sign(byte[] originalBytes) {    
        KeyStoreConfig store = KeyStoreConfig.instance();
       
        try {                       
            InputStream is = Resources.getResourceAsStream(store.getKeyStore());
           
            KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
            ks.load(is, store.getKeyStorePassword().toCharArray());

            PrivateKey key = (PrivateKey) ks.getKey(store.getKeyAlias(),
                        store.getKeyPassword().toCharArray());
            Certificate[] chain =  ks.getCertificateChain(store.getKeyAlias());

            PdfReader reader = new PdfReader(originalBytes);
            ByteArrayOutputStream os = new ByteArrayOutputStream();                

            PdfStamper stamper = PdfStamper.createSignature(reader, os, '\0');
View Full Code Here

Examples of org.jboss.seam.pdf.KeyStoreConfig

      return null;
   }

   public byte[] sign(byte[] originalBytes)
   {
      KeyStoreConfig store = KeyStoreConfig.instance();
      InputStream is = null;
      try {
         is = FacesResources.getResourceAsStream(store.getKeyStore(), getFacesContext().getExternalContext());

         KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
         ks.load(is, store.getKeyStorePassword().toCharArray());

         PrivateKey key = (PrivateKey) ks.getKey(store.getKeyAlias(), store.getKeyPassword().toCharArray());
         Certificate[] chain = ks.getCertificateChain(store.getKeyAlias());

         PdfReader reader = new PdfReader(originalBytes);
         ByteArrayOutputStream os = new ByteArrayOutputStream();

         PdfStamper stamper = PdfStamper.createSignature(reader, os, '\0');
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.