Examples of Signature


Examples of java.security.Signature

        try {
            this.signatureAlgorithm.initVerify((PublicKey) publicKey);
        } catch (InvalidKeyException ex) {
            // reinstantiate Signature object to work around bug in JDK
            // see: http://bugs.sun.com/view_bug.do?bug_id=4953555
            Signature sig = this.signatureAlgorithm;
            try {
                this.signatureAlgorithm = Signature.getInstance(signatureAlgorithm.getAlgorithm());
            } catch (Exception e) {
                // this shouldn't occur, but if it does, restore previous
                // Signature
View Full Code Here

Examples of java.security.Signature

       
        // Verify the signature on SPKAC
        String signAlgString = PKCSObjectIdentifiers.md5WithRSAEncryption.equals(alg0) ? "MD5withRSA" :
                               PKCSObjectIdentifiers.md2WithRSAEncryption.equals(alg0) ? "MD2withRSA" :
                               PKCSObjectIdentifiers.sha1WithRSAEncryption.equals(alg0) ? "SHA1withRSA" : null;
        Signature signObj = Signature.getInstance(signAlgString);
        signObj.initVerify(pubKey);
        signObj.update(pkacSeq.getEncoded());
        boolean verified = signObj.verify(signature);
        if(!verified) throw new Exception("SignedPublicKeyAndChallenge verification failed.");
        map.put(CERT_REQ_PUBLICKEY, pkInfo);
        map.put(CERT_REQ_PUBLICKEY_OBJ, pubKey);
        if(((DERString)ch).getString() != null) map.put(PKAC_CHALLENGE, ((DERString)ch).getString());
        return map;
View Full Code Here

Examples of jfun.yan.function.Signature

    return bindProperties(cc, new PropertyBinder(){
      public Creator bind(Class component_type, Object key, Class type){
        final int ind = findKey(key);
        if(ind < 0) return useProperty(component_type, key, type);
        else{
          final Signature sig = new Property2Signature(component_type, key, type);
          return useArgument(sig, ind, type);
        }
      }
      private int findKey(Object k){
        for(int i=0; i<keys.length;i++){
View Full Code Here

Examples of net.buffalo.protocal.Signature

  public void invoke(Object service, Reader reader, Writer writer) {
    invoke0(service, writer, BuffaloProtocal.getInstance().unmarshall(reader));
  }

  private void invoke0(Object service, Writer writer, BuffaloCall call) {
    Signature signature = new Signature(service.getClass(),
        call.getMethodName(), call.getArgumentTypes());
   
    Method method = null;
    if (methodCache.get(signature) != null) {
      method = (Method) methodCache.get(signature);
View Full Code Here

Examples of net.schmizz.sshj.signature.Signature

                .putMPInt(f)
                .putMPInt(dh.getK());
        sha1.update(buf.array(), buf.rpos(), buf.available());
        H = sha1.digest();

        Signature signature = Factory.Named.Util.create(trans.getConfig().getSignatureFactories(),
                                                        KeyType.fromKey(hostKey).toString());
        signature.init(hostKey, null);
        signature.update(H, 0, H.length);
        if (!signature.verify(sig))
            throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED,
                                         "KeyExchange signature verification failed");
        return true;
    }
View Full Code Here

Examples of net.sf.cglib.core.Signature

        this.methodName = methodName;
        this.methodDesc = methodDesc;
    }

    public Signature getSignature() {
        return new Signature(methodName, methodDesc);
    }
View Full Code Here

Examples of net.sf.cglib.core.Signature

        this.handlerInfoChainFactory = new HandlerInfoChainFactory(handlerInfos);
        sortedOperationInfos = new OperationInfo[FastClass.create(serviceEndpointClass).getMaxIndex() + 1];
        String encodingStyle = "";
        for (int i = 0; i < operationInfos.length; i++) {
            OperationInfo operationInfo = operationInfos[i];
            Signature signature = operationInfo.getSignature();
            MethodProxy methodProxy = MethodProxy.find(serviceEndpointClass, signature);
            if (methodProxy == null) {
                throw new RuntimeException("No method proxy for operationInfo " + signature);
            }
            int index = methodProxy.getSuperIndex();
View Full Code Here

Examples of net.sf.rej.java.attribute.generics.Signature

    }
   
    private static void getSignatureImports(Imports imports, Attributes attrs) {
      SignatureAttribute attr = attrs.getSignatureAttribute();
      if (attr != null) {
        Signature signature = Signatures.getSignature(attr.getSignatureString());
        List<FormalTypeParameter> typeParams = signature.getFormalTypeParameters();
        if (typeParams != null) {
          for (FormalTypeParameter typeParam : typeParams) {
            for (GenericJavaType type : typeParam.getTypeUnion()) {
              getGenericJavaTypeImports(imports, type);
            }
          }
        }
       
        List<GenericJavaType> methodParams = signature.getMethodParameters();
        if (methodParams != null) {
            for (GenericJavaType param : methodParams) {
              getGenericJavaTypeImports(imports, param);
            }         
        }
        List<GenericJavaType> types = signature.getTypes();
        for (GenericJavaType type : types) {
          getGenericJavaTypeImports(imports, type);
        }
      }
    }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.Signature

      try
      {
        EbMSMessage msg = (EbMSMessage)message.getPayload();
        MessageHeader messageHeader = msg.getMessageHeader();
        CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
        Signature signature = (Signature)message.getProperty(Constants.EBMS_SIGNATURE);
        PartyInfo partyInfo = CPAUtils.getPartyInfo(cpa,messageHeader.getFrom().getPartyId());
        List<DeliveryChannel> deliveryChannels = CPAUtils.getDeliveryChannels(partyInfo,messageHeader.getFrom().getRole(),messageHeader.getService(),messageHeader.getAction());
        if (CPAUtils.isSigned(deliveryChannels.get(0)))
        {
          if (signature == null)
          {
            message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/Signature",Constants.EbMSErrorCode.SECURITY_FAILURE.errorCode(),"No signature found."));
            return false;
          }
          if (!signature.isValid())
          {
            message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/Signature",Constants.EbMSErrorCode.SECURITY_FAILURE.errorCode(),"Signature invalid."));
            return false;
          }
        }
View Full Code Here

Examples of org.apache.abdera.security.Signature

    entry.setContentAsXhtml("This <b>is</b> <i>markup</i>");
    entry.addAuthor("James");
    entry.addLink("http://www.example.org");
   
    // Prepare the digital signature options
    Signature sig = absec.getSignature();
    SignatureOptions options = sig.getDefaultSignatureOptions();   
    options.setCertificate(cert);
    options.setSigningKey(signingKey)

    // Sign the entry
    entry = sig.sign(entry, options);
    assertNotNull(
      entry.getFirstChild(
        new QName(
          "http://www.w3.org/2000/09/xmldsig#",
          "Signature")));
     
    X509Certificate[] certs = sig.getValidSignatureCertificates(entry, options);
    assertNotNull(certs);
    assertEquals(certs.length, 1);
    assertEquals(certs[0].getSubjectDN().getName(), "CN=James M Snell, OU=WebAhead, O=IBM, L=Hanford, ST=California, C=US");
   
    // Check the round trip
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    entry.writeTo(out); // do not use the pretty writer, it will break the signature
    ByteArrayInputStream bais = new ByteArrayInputStream(out.toByteArray());
    Document<Entry> entry_doc = abdera.getParser().parse(bais);
    entry = entry_doc.getRoot();
    assertTrue(sig.verify(entry, null))// the signature better still be valid
   
    entry.setTitle("Change the title");
   
    assertFalse(sig.verify(entry, null)); // the signature better be invalid
   
  }
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.