jdk/src/share/classes/sun/security/pkcs11/P11RSACipher.java
changeset 5291 d6df082f6524
parent 2180 9994f4f08a59
child 5506 202f599c92aa
equal deleted inserted replaced
5202:20198b5f3653 5291:d6df082f6524
     1 /*
     1 /*
     2  * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 2003-2010 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Sun designates this
     7  * published by the Free Software Foundation.  Sun designates this
   483     // see JCE spec
   483     // see JCE spec
   484     protected int engineGetKeySize(Key key) throws InvalidKeyException {
   484     protected int engineGetKeySize(Key key) throws InvalidKeyException {
   485         int n = P11KeyFactory.convertKey(token, key, algorithm).keyLength();
   485         int n = P11KeyFactory.convertKey(token, key, algorithm).keyLength();
   486         return n;
   486         return n;
   487     }
   487     }
   488 
       
   489     protected void finalize() throws Throwable {
       
   490         try {
       
   491             if ((session != null) && token.isValid()) {
       
   492                 cancelOperation();
       
   493                 session = token.releaseSession(session);
       
   494             }
       
   495         } finally {
       
   496             super.finalize();
       
   497         }
       
   498     }
       
   499 
       
   500 }
   488 }
   501 
   489 
   502 final class ConstructKeys {
   490 final class ConstructKeys {
   503     /**
   491     /**
   504      * Construct a public key from its encoding.
   492      * Construct a public key from its encoding.