Examples of Signature


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")));
View Full Code Here

Examples of org.apache.axis.tools.common.Signature

  private void generateFunctionPrototype(
    FilePart fp,
    BufferedWriter outputFile)
    throws Exception {

    Signature sign = null;
    if (FilePart.PROTOTYPE == fp.getType()) {
      PrototypePart pp = (PrototypePart) fp;
      sign = pp.getSignature();
    } else {
      MethodPart mp = (MethodPart) fp;
      sign = mp.getSignature();
    }
   
    // Ignore private methods.
    if (!sign.getScope().equals("public") &&
        !sign.getScope().equals("protected"))
      return;
       
    String classname = sign.getClassName();
    if (null != classname && classname.endsWith("::"))
      classname = classname.substring(0, classname.length() - 2);
    String method = sign.getMethodName();
    if (Configuration.methodExcluded(classname, method))
      return;
   
    Parameter[] parms = sign.getParameters();
    String text = new String();

    // Look to see if this method is overloaded by another method
    // in the same class or a different class. If methods in two
    // different classes happen to have the same name, then change
    // their names. If methods are overloaded in the same class then
    // convert the longest method prototype to C. We should really
    // superset the parameters in the two prototypes instead of
    // picking the longest one.
    List overloads = headers.getMethods(method);
    boolean sameClass = true;
    if (overloads.size() > 1) {
      Iterator it = overloads.iterator();
      while (it.hasNext()) {
        Signature s = (Signature) it.next();
        if (!s.getTrimClassName().equals(classname))
          sameClass = false;
        else {
          int n1 = 0;
          int n2 = 0;
          if (null != s.getParameters())
            n1 = s.getParameters().length;
          if (null != sign.getParameters())
            n2 = sign.getParameters().length;
          if (n1 > n2)
            return;
        }
View Full Code Here

Examples of org.apache.bcel.classfile.Signature

            GenericSignatureParser parser = null;
            String genericSignature = null;
            for (Attribute a : target.getAttributes()) {
                if (a instanceof Signature) {

                    Signature sig = (Signature) a;
                    if (genericSignature != null) {
                        if (!genericSignature.equals(sig.getSignature())) {
                            if (false) {
                                System.out.println("Inconsistent signatures: ");
                                System.out.println(genericSignature);
                                System.out.println(sig.getSignature());
                            }
                            return null; // we've seen two inconsistent
                            // signatures
                        }
                        continue;
                    }

                    genericSignature = sig.getSignature();
                    if (compareSignatures(target.getSignature(), genericSignature)) {
                        parser = new GenericSignatureParser(genericSignature);
                    }
                }
            }
View Full Code Here

Examples of org.apache.juddi.model.Signature

        private static List<Signature> mapApiSignaturesToModelSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures)
           throws DispositionReportFaultMessage {
            List<Signature> modelSignatures = new ArrayList<Signature>();
            modelSignatures.clear();
            for (org.w3._2000._09.xmldsig_.SignatureType signatureType : apiSignatures) {
                Signature modelSignature = new Signature();
               
                org.w3._2000._09.xmldsig_.SignedInfoType apiSignedInfo = signatureType.getSignedInfo();
                SignedInfo modelSignedInfo = new SignedInfo();
                modelSignature.setSignedInfo(modelSignedInfo);
               
                String canonicalizationAlgMethod = apiSignedInfo.getCanonicalizationMethod().getAlgorithm();
                CanonicalizationMethod modelCanonMethod = new CanonicalizationMethod();
                modelSignedInfo.setCanonicalizationMethod(modelCanonMethod);
                modelCanonMethod.setAlgorithm(canonicalizationAlgMethod);
               
                SignatureMethod modelSigMethod = new SignatureMethod();
                modelSignedInfo.setSignatureMethod(modelSigMethod);
                String sigMethod = apiSignedInfo.getSignatureMethod().getAlgorithm();
                modelSigMethod.setAlgorithm(sigMethod);
               
                List<org.w3._2000._09.xmldsig_.ReferenceType> apiReferenceList = apiSignedInfo.getReference();
                for (org.w3._2000._09.xmldsig_.ReferenceType apiReference : apiReferenceList) {
                    Reference ref = mapReference(modelSignedInfo, apiReference);
                    modelSignedInfo.getReference().add(ref);
                }
               
                modelSignedInfo.setCanonicalizationMethod(modelCanonMethod);
               
                org.w3._2000._09.xmldsig_.SignatureValueType apiSignatureValue = signatureType.getSignatureValue();
                SignatureValue modelSignatureValue = new SignatureValue();
                byte[] signatureValueBytes = apiSignatureValue.getValue();
                String signatureValueXmlID = apiSignatureValue.getId();
                modelSignatureValue.setValue(signatureValueBytes);
                modelSignatureValue.setXmlID(signatureValueXmlID);
                modelSignature.setSignatureValue(modelSignatureValue);
               
                org.w3._2000._09.xmldsig_.KeyInfoType apiKeyInfo = signatureType.getKeyInfo();
                String apiKeyInfoXmlID = apiKeyInfo.getId();
                KeyInfo modelKeyInfo = new KeyInfo();
                modelSignature.setKeyInfo(modelKeyInfo);
                modelKeyInfo.setXmlID(apiKeyInfoXmlID);
               
                List<Object> apiKeyInfoContentList = apiKeyInfo.getContent();
                List<KeyDataValue> keyInfoDataValues = modelKeyInfo.getKeyDataValue();
                for (Object apiKeyInfoContentObj : apiKeyInfoContentList) {
View Full Code Here

Examples of org.apache.sshd.common.Signature

        int len = buffer.getInt();
        buffer.wpos(buffer.rpos() + len);
        PublicKey key = buffer.getRawPublicKey();
        String keyAlg = (key instanceof RSAPublicKey) ? KeyPairProvider.SSH_RSA : KeyPairProvider.SSH_DSS;

        Signature verif = NamedFactory.Utils.create(session.getFactoryManager().getSignatureFactories(), keyAlg);
        verif.init(key, null);
        buffer.wpos(oldLim);

        byte[] sig = hasSig ? buffer.getBytes() : null;

        PublickeyAuthenticator authenticator = session.getServerFactoryManager().getPublickeyAuthenticator();
        if (authenticator == null) {
            throw new Exception("No PublickeyAuthenticator configured");
        }

        if (!authenticator.authenticate(username, key, session)) {
            return false;
        }
        if (!hasSig) {
            Buffer buf = session.createBuffer(SshConstants.Message.SSH_MSG_USERAUTH_PK_OK, 0);
            buf.putString(alg);
            buf.putRawBytes(buffer.array(), oldPos, 4 + len);
            session.writePacket(buf);
            return null;
        } else {
            Buffer buf = new Buffer();
            buf.putString(session.getKex().getH());
            buf.putCommand(SshConstants.Message.SSH_MSG_USERAUTH_REQUEST);
            buf.putString(username);
            buf.putString("ssh-connection");
            buf.putString("publickey");
            buf.putByte((byte) 1);
            buf.putString(keyAlg);
            buffer.rpos(oldPos);
            buffer.wpos(oldPos + 4 + len);
            buf.putBuffer(buffer);
            verif.update(buf.array(), buf.rpos(), buf.available());
            if (!verif.verify(sig)) {
                throw new Exception("Key verification failed");
            }
            return true;
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.cpp.tools.common.Signature

            List methods = headers.getAllMethods();
           
            // Pull out one of the methods' namespace attributes.
            String intfNamespace = null;
            if (methods.size() > 0) {
                Signature method = (Signature) methods.get(0);
                intfNamespace = method.getNamespace();
            }

            if (interfaceClassNameAttrFromComponentTypeFile != null) {
                methods = filterToPublicMethodsOfGivenClass(methods,
                        interfaceClassNameAttrFromComponentTypeFile, true);
View Full Code Here

Examples of org.apache.vxquery.functions.Signature

                            if (pNode.getType() != null) {
                                pType = createSequenceType(pNode.getType());
                            }
                            paramTypes[i] = Pair.<QName, SequenceType> of(pName, pType);
                        }
                        Signature sign = new Signature(rType, paramTypes);
                        Function f = external ? new ExternalFunction(name, sign) : new UserDefinedXQueryFunction(name,
                                sign, null);
                        moduleCtx.registerFunction(f);
                        break;
                    }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.Signature

   * Helper method to create a signature attribute based on a string signature: e.g. "Ljava/lang/Object;LI<Ljava/lang/Double;>;"
   */
  private Signature createSignatureAttribute(ConstantPool cp, String signature) {
    int nameIndex = cp.addUtf8("Signature");
    int sigIndex = cp.addUtf8(signature);
    return new Signature(nameIndex, 2, sigIndex, cp);
  }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.Signature

    if (!regenerateGenericSignatureAttribute) {
      return;
    }

    // 2. Find the old attribute
    Signature sigAttr = null;
    if (myType != null) { // if null, this is a type built from scratch, it
      // won't already have a sig attribute
      sigAttr = (Signature) myGen.getAttribute("Signature");
    }
View Full Code Here

Examples of org.aspectj.apache.bcel.classfile.Signature

   * Helper method to create a signature attribute based on a string signature: e.g. "Ljava/lang/Object;LI<Ljava/lang/Double;>;"
   */
  private Signature createSignatureAttribute(String signature) {
    int nameIndex = cp.addUtf8("Signature");
    int sigIndex = cp.addUtf8(signature);
    return new Signature(nameIndex, 2, sigIndex, cp);
  }
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.