Examples of sign()


Examples of org.opensaml.SAMLAssertion.sign()

            if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
                sigAlgo = XMLSignature.ALGO_ID_SIGNATURE_DSA;
            }
            java.security.Key issuerPK = crypto.getPrivateKey(
                    config.issuerKeyAlias, config.issuerKeyPassword);
            assertion.sign(sigAlgo, issuerPK, Arrays.asList(issuerCerts));

            return assertion;
        } catch (Exception e) {
            throw new TrustException("samlAssertionCreationError", e);
        }
View Full Code Here

Examples of org.openxri.xml.XRD.sign()

                XRD oDesc =
                    XRD.constructXRIDescriptor(sDescStr, false);
                Assertion oAssertion =
                    createAssertion(sNewXMLID.toString(), sID, sSubsegment);
                oDesc.setSAMLAssertion(oAssertion);
                oDesc.sign(moPrivateKey);
                Element oElem = oDesc.getDOM();
                oEnv.setDescriptor(DOMUtils.toString(oElem, false, true));
            }
            catch (Exception oEx)
            {
View Full Code Here

Examples of org.picketlink.identity.federation.api.saml.v2.sig.SAML2Signature.sign()

        }

        if (supportSignature) {
            try {
                SAML2Signature ss = new SAML2Signature();
                samlResponse = ss.sign(responseType, keyManager.getSigningKeyPair());
            } catch (Exception e) {
                logger.trace(e);
                throw new RuntimeException(logger.signatureError(e));
            }
        } else
View Full Code Here

Examples of org.springframework.security.oauth.common.signature.HMAC_SHA1SignatureMethod.sign()

    theirMethod.setConsumerSecret("xxxxxx");
    theirMethod.setTokenSecret("");
    SecretKeySpec spec = new SecretKeySpec("xxxxxx&".getBytes("UTF-8"), HMAC_SHA1SignatureMethod.MAC_NAME);
    HMAC_SHA1SignatureMethod ourMethod = new HMAC_SHA1SignatureMethod(spec);
    String theirSignature = theirMethod.getSignature(baseString);
    String ourSignature = ourMethod.sign(baseString);
    assertEquals(theirSignature, ourSignature);
  }

  /**
   * tests compatibility of calculating the signature base string.
View Full Code Here

Examples of org.springframework.security.oauth.common.signature.OAuthSignatureMethod.sign()

      signatureMethod = getSignatureFactory().getSignatureMethod(details.getSignatureMethod(), details.getSharedSecret(), tokenSecret);
    }
    catch (UnsupportedSignatureMethodException e) {
      throw new OAuthRequestFailedException(e.getMessage(), e);
    }
    String signature = signatureMethod.sign(signatureBaseString);
    oauthParams.put(OAuthConsumerParameter.oauth_signature.toString(), Collections.singleton((CharSequence) signature));
    return oauthParams;
  }

  /**
 
View Full Code Here

Examples of org.vngx.jsch.algorithm.SignatureDSA.sign()

      case SSH_DSS: {
        try {
          SignatureDSA dsa = AlgorithmManager.getManager().createAlgorithm(Algorithms.SIGNATURE_DSS);
          dsa.setPrvKey(_prvKeyDSA, _pDSA, _qDSA, _gDSA);
          dsa.update(data);
          byte[] sig = dsa.sign();
          byte[] buffer = new byte[KeyType.SSH_DSS.toString().length() + 4 + sig.length + 4];
          Buffer buf = new Buffer(buffer);
          buf.putString(KeyType.SSH_DSS.getBytes());
          buf.putString(sig);
          return buffer;
View Full Code Here

Examples of org.vngx.jsch.algorithm.SignatureRSA.sign()

      case SSH_RSA: {
        try {
          SignatureRSA rsa = AlgorithmManager.getManager().createAlgorithm(Algorithms.SIGNATURE_RSA);
          rsa.setPrvKey(_dRSA, _nRSA);
          rsa.update(data);
          byte[] sig = rsa.sign();
          byte[] buffer = new byte[KeyType.SSH_RSA.toString().length() + 4 + sig.length + 4];
          Buffer buf = new Buffer(buffer);
          buf.putString(KeyType.SSH_RSA.getBytes());
          buf.putString(sig);
          return buffer;
View Full Code Here

Examples of org.xbill.DNS.utils.HMAC.sign()

  if (hmac != null)
    hmac.update(out.toByteArray());

  byte [] signature;
  if (hmac != null)
    signature = hmac.sign();
  else
    signature = new byte[0];

  byte [] other = null;
  if (error == Rcode.BADTIME) {
View Full Code Here

Examples of restx.security.Signer.sign()

        String uuid = factory.getComponent(UUIDGenerator.class).doGenerate();
        String expires = DateTime.now().plusHours(1).toString();
        String sessionContent = String.format(
                "{\"_expires\":\"%s\",\"principal\":\"%s\",\"sessionKey\":\"%s\"}", expires, principal, uuid);
        cookiesBuilder.put(restxSessionCookieDescriptor.getCookieName(), sessionContent);
        cookiesBuilder.put(restxSessionCookieDescriptor.getCookieSignatureName(), signer.sign(sessionContent));

        return new HttpTestClient(baseUrl, principal, cookiesBuilder.build());
    }

    public HttpTestClient withCookie(String cookieName, String cookieValue) {
View Full Code Here

Examples of sun.security.x509.X509CertImpl.sign()

    AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);
    info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo));

    // Sign the cert to identify the algorithm that's used.
    X509CertImpl cert = new X509CertImpl(info);
    cert.sign(privkey, algorithm);

    // Update the algorith, and resign.
    algo = (AlgorithmId) cert.get(X509CertImpl.SIG_ALG);
    info
        .set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM,
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.