< prev index next >

jdk/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeKey.java

Print this page




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.oracle.security.ucrypto;
  27 
  28 import java.util.Set;
  29 import java.util.Arrays;
  30 import java.util.concurrent.ConcurrentSkipListSet;
  31 import java.lang.ref.*;
  32 
  33 import java.math.BigInteger;
  34 import java.security.*;
  35 import java.security.interfaces.*;
  36 import java.security.spec.*;
  37 
  38 /**
  39  * Wrapper class for native keys needed for using ucrypto APIs.
  40  * This class currently supports native RSA private/public keys.
  41  *
  42  * @since 1.9
  43  */
  44 abstract class NativeKey implements Key {
  45 
  46     private static final long serialVersionUID = 6812507588904302830L;
  47 
  48     private final int numComponents;
  49 
  50     NativeKey(int numComponents) {
  51         this.numComponents = numComponents;
  52     }
  53 
  54     abstract long value();
  55 
  56     int length() {
  57         return numComponents;
  58     }
  59 
  60     public String getAlgorithm() { return "RSA"; }
  61     public String getFormat() { return "RAW"; }
  62     public byte[] getEncoded() {




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.oracle.security.ucrypto;
  27 
  28 import java.util.Set;
  29 import java.util.Arrays;
  30 import java.util.concurrent.ConcurrentSkipListSet;
  31 import java.lang.ref.*;
  32 
  33 import java.math.BigInteger;
  34 import java.security.*;
  35 import java.security.interfaces.*;
  36 import java.security.spec.*;
  37 
  38 /**
  39  * Wrapper class for native keys needed for using ucrypto APIs.
  40  * This class currently supports native RSA private/public keys.
  41  *
  42  * @since 9
  43  */
  44 abstract class NativeKey implements Key {
  45 
  46     private static final long serialVersionUID = 6812507588904302830L;
  47 
  48     private final int numComponents;
  49 
  50     NativeKey(int numComponents) {
  51         this.numComponents = numComponents;
  52     }
  53 
  54     abstract long value();
  55 
  56     int length() {
  57         return numComponents;
  58     }
  59 
  60     public String getAlgorithm() { return "RSA"; }
  61     public String getFormat() { return "RAW"; }
  62     public byte[] getEncoded() {


< prev index next >