Examples of sign()


Examples of java.security.Signature.sign()

                 
                  error.printStackTrace();
                }
              },
              req,
              sig.sign());
           
          }else{
           
            usage();
          }
View Full Code Here

Examples of java.security.Signature.sign()

    try{
      Signature sig = CryptoECCUtils.getSignature( CryptoECCUtils.rawdataToPrivkey( private_key ));

      sig.update( ( name + pk_str + sid_str + version + content ).getBytes( "UTF-8" ));
     
      byte[]  sig_bytes = sig.sign();
     
      /*
      Signature verify = CryptoECCUtils.getSignature( CryptoECCUtils.rawdataToPubkey( public_key ));

      verify.update( ( name + pk_str + sid_str + version + content ).getBytes( "UTF-8" ));
View Full Code Here

Examples of java.security.Signature.sign()

        catch (Exception e)
        {
            throw new SecurityException("exception encoding TBS cert request - " + e);
        }

        this.sigBits = new DERBitString(sig.sign());
    }

    /**
     * return the public key associated with the certification request -
     * the public key is created using the BC provider.
View Full Code Here

Examples of java.security.Signature.sign()

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(tbsCert);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CertificateObject(new X509CertificateStructure(new DERSequence(v)));
    }
}
View Full Code Here

Examples of java.security.Signature.sign()

        // Construct the CRL
        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(tbsCrl);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CRLObject(new CertificateList(new DERSequence(v)));
    }
}
View Full Code Here

Examples of java.security.Signature.sign()

            sig.initSign(key);
        }

        sig.update(object.getEncoded(ASN1Encodable.DER));

        return sig.sign();
    }

    static byte[] calculateSignature(
        DERObjectIdentifier sigOid,
        String              sigName,
View Full Code Here

Examples of java.security.Signature.sign()

            sig.initSign(key);
        }

        sig.update(object.getEncoded(ASN1Encodable.DER));

        return sig.sign();
    }

    static X509Principal convertPrincipal(
        X500Principal principal)
    {
View Full Code Here

Examples of java.security.Signature.sign()

            sig.initSign(prvKey);
            sig.update(data);

            ByteArrayWriter baw = new ByteArrayWriter();
            baw.writeString(getAlgorithmName());
            baw.writeBinaryString(sig.sign());

            return baw.toByteArray();
        } catch (Exception e) {
            return null;
        }
View Full Code Here

Examples of java.security.Signature.sign()

            Signature sig = Signature.getInstance("SHA1withDSA");
            sig.initSign(prvkey);

            sig.update(data);

            byte[] signature = sig.sign();
            byte[] decoded = new byte[40];
            SimpleASNReader asn = new SimpleASNReader(signature);
            asn.getByte();
            asn.getLength();
            asn.getByte();
View Full Code Here

Examples of java.security.Signature.sign()

      if (!first) dosetaBuffer.append(";");
      dosetaBuffer.append("b=");
      String dosetaHeader = dosetaBuffer.toString();
      signature.update(dosetaHeader.getBytes());

      byte[] signed = signature.sign();
      setSignature(signed);
      String base64Signature = Base64.encodeBytes(signed);
      dosetaHeader += base64Signature;
//      System.out.println("***: " + dosetaHeader);
      this.headerValue = dosetaHeader;
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.