Java Doc for X509Key.java in  » 6.0-JDK-Modules » j2me » sun » security » x509 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » sun.security.x509 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.security.x509.X509Key

All known Subclasses:   sun.security.provider.DSAPublicKey,
X509Key
public class X509Key implements PublicKey(Code)
Holds an X.509 key, for example a public key found in an X.509 certificate. Includes a description of the algorithm to be used with the key; these keys normally are used as "SubjectPublicKeyInfo".

While this class can represent any kind of X.509 key, it may be desirable to provide subclasses which understand how to parse keying data. For example, RSA public keys have two members, one for the public modulus and one for the prime exponent. If such a class is provided, it is used when parsing X.509 keys. If one is not provided, the key still parses correctly.
version:
   1.81, 02/02/00
author:
   David Brownell



Field Summary
protected  AlgorithmIdalgid
    
protected  byte[]encodedKey
    
protected  byte[]key
     The key bytes, without the algorithm information.

Constructor Summary
public  X509Key()
     Default constructor.

Method Summary
static  PublicKeybuildX509Key(AlgorithmId algid, BitArray key)
    
public  voiddecode(InputStream in)
     Initialize an X509Key object from an input stream.
public  voiddecode(byte[] encodedKey)
    
final public  voidencode(DerOutputStream out)
     Encode SubjectPublicKeyInfo sequence on the DER output stream.
public  byte[]encode()
     Returns the DER-encoded form of the key as a byte array.
static  voidencode(DerOutputStream out, AlgorithmId algid, BitArray key)
    
public  booleanequals(Object obj)
    
public  StringgetAlgorithm()
     Returns the algorithm to be used with this key.
public  AlgorithmIdgetAlgorithmId()
     Returns the algorithm ID to be used with this key.
public  byte[]getEncoded()
     Returns the DER-encoded form of the key as a byte array.
public  byte[]getEncodedInternal()
    
public  StringgetFormat()
    
protected  BitArraygetKey()
     Gets the key.
public  inthashCode()
     Calculates a hash code value for the object.
public static  PublicKeyparse(DerValue in)
     Construct X.509 subject public key from a DER value.
protected  voidparseKeyBits()
     Parse the key bits.
protected  voidsetKey(BitArray key)
     Sets the key in the BitArray form.
public  StringtoString()
    

Field Detail
algid
protected AlgorithmId algid(Code)



encodedKey
protected byte[] encodedKey(Code)



key
protected byte[] key(Code)
The key bytes, without the algorithm information.
See Also:   sun.security.x509.X509Key.setKey(BitArray)
See Also:   sun.security.x509.X509Key.getKey




Constructor Detail
X509Key
public X509Key()(Code)
Default constructor. The key constructed must have its key and algorithm initialized before it may be used, for example by using decode.




Method Detail
buildX509Key
static PublicKey buildX509Key(AlgorithmId algid, BitArray key) throws IOException, InvalidKeyException(Code)



decode
public void decode(InputStream in) throws InvalidKeyException(Code)
Initialize an X509Key object from an input stream. The data on that input stream must be encoded using DER, obeying the X.509 SubjectPublicKeyInfo format. That is, the data is a sequence consisting of an algorithm ID and a bit string which holds the key. (That bit string is often used to encapsulate another DER encoded sequence.)

Subclasses should not normally redefine this method; they should instead provide a parseKeyBits method to parse any fields inside the key member.

The exception to this rule is that since private keys need not be encoded using the X.509 SubjectPublicKeyInfo format, private keys may override this method, encode, and of course getFormat.
Parameters:
  in - an input stream with a DER-encoded X.509SubjectPublicKeyInfo value
exception:
  InvalidKeyException - on parsing errors.




decode
public void decode(byte[] encodedKey) throws InvalidKeyException(Code)



encode
final public void encode(DerOutputStream out) throws IOException(Code)
Encode SubjectPublicKeyInfo sequence on the DER output stream.
exception:
  IOException - on encoding errors.



encode
public byte[] encode() throws InvalidKeyException(Code)
Returns the DER-encoded form of the key as a byte array.
exception:
  InvalidKeyException - on encoding errors.



encode
static void encode(DerOutputStream out, AlgorithmId algid, BitArray key) throws IOException(Code)



equals
public boolean equals(Object obj)(Code)



getAlgorithm
public String getAlgorithm()(Code)
Returns the algorithm to be used with this key.



getAlgorithmId
public AlgorithmId getAlgorithmId()(Code)
Returns the algorithm ID to be used with this key.



getEncoded
public byte[] getEncoded()(Code)
Returns the DER-encoded form of the key as a byte array.



getEncodedInternal
public byte[] getEncodedInternal() throws InvalidKeyException(Code)



getFormat
public String getFormat()(Code)
Returns the format for this key: "X.509"



getKey
protected BitArray getKey()(Code)
Gets the key. The key may or may not be byte aligned. a BitArray containing the key.



hashCode
public int hashCode()(Code)
Calculates a hash code value for the object. Objects which are equal will also have the same hashcode.



parse
public static PublicKey parse(DerValue in) throws IOException(Code)
Construct X.509 subject public key from a DER value. If the runtime environment is configured with a specific class for this kind of key, a subclass is returned. Otherwise, a generic X509Key object is returned.

This mechanism gurantees that keys (and algorithms) may be freely manipulated and transferred, without risk of losing information. Also, when a key (or algorithm) needs some special handling, that specific need can be accomodated.
Parameters:
  in - the DER-encoded SubjectPublicKeyInfo value
exception:
  IOException - on data format errors




parseKeyBits
protected void parseKeyBits() throws IOException, InvalidKeyException(Code)
Parse the key bits. This may be redefined by subclasses to take advantage of structure within the key. For example, RSA public keys encapsulate two unsigned integers (modulus and exponent) as DER values within the key bits; Diffie-Hellman and DSS/DSA keys encapsulate a single unsigned integer.

This function is called when creating X.509 SubjectPublicKeyInfo values using the X509Key member functions, such as parse and decode.
exception:
  IOException - on parsing errors.
exception:
  InvalidKeyException - on invalid key encodings.




setKey
protected void setKey(BitArray key)(Code)
Sets the key in the BitArray form.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.