Package java.security

Examples of java.security.Key

Keys are generally obtained through key generators, certificates, or various Identity classes used to manage keys. Keys may also be obtained from key specifications (transparent representations of the underlying key material) through the use of a key factory (see {@link KeyFactory}).

A Key should use KeyRep as its serialized representation. Note that a serialized Key may contain sensitive information which should not be exposed in untrusted environments. See the Security Appendix of the Serialization Specification for more information. @see PublicKey @see PrivateKey @see KeyPair @see KeyPairGenerator @see KeyFactory @see KeyRep @see java.security.spec.KeySpec @see Identity @see Signer @version 1.57 06/04/21 @author Benjamin Renaud


      }
     
      java.util.Iterator iter = aliases1.iterator();
      java.util.Iterator iter3 = aliases3.iterator();
      while (iter.hasNext() || iter3.hasNext()) {
        Key current = null;
       
        if(iter.hasNext()){
          String alias = (String) iter.next();
          current = getPublicKey(alias, type);
        }else{
View Full Code Here


//                  if(session.transport.digest == null &&
//                          (session.transport.server.securityMode & 0x0f)!=0){
                        if(session.transport.digest == null &&
                                (session.transport.server.signaturesRequired ||
                                        (session.transport.server.signaturesEnabled && SmbConstants.SIGNPREF))){
                        Key key = context.searchSessionKey(subject);
                        if(key == null){
                            throw new SmbException("Not found the session key.");
                        }
                        request.digest = new SigningDigest(key.getEncoded());
                    }
   
                    session.transport.send( request, response );
                    session.transport.digest = request.digest;
                   
View Full Code Here

    try {
      Cipher cipher = Cipher.getInstance("RSA");

      cipher.init(Cipher.UNWRAP_MODE, _authKeyPair.getPrivate());

      Key key = cipher.unwrap(encKey, keyAlgorithm, Cipher.SECRET_KEY);

      return key;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2000/09/xmldsig#sha1";
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#sha224";
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#sha256";
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#sha384";
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#sha512";
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2001/04/xmlenc#ripemd160";
View Full Code Here

        KeyStore keyStore = KeyStore.getInstance("jks");
        keyStore.load(
                this.getClass().getClassLoader().getResource("transmitter.jks").openStream(),
                "default".toCharArray()
        );
        Key key = keyStore.getKey("transmitter", "default".toCharArray());
        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate)keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});
       
        String digestAlgorithm = "http://www.w3.org/2007/05/xmldsig-more#whirlpool";
View Full Code Here

TOP

Related Classes of java.security.Key

Copyright © 2018 www.massapicom. 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.