Java Doc for SignedAspect.java in  » Byte-Code » PROSE » ch » ethz » prose » 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 » Byte Code » PROSE » ch.ethz.prose 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ch.ethz.prose.Aspect
      ch.ethz.prose.SignedAspect

SignedAspect
final public class SignedAspect extends Aspect (Code)
Class SignedAspect is a wrapper for an Aspect contained in a SignedObject. Thus it is possible to verify the signer of the extension before it is used. For security reason, this class is (and has to be) declared final

At construction, the public and private keys passed as KeyPair are not checked for being a valid pair and the private key is not stored for later use. Only an explicit call to verifyExtension does check the public key stored. The signing algorithm to use is deduced by the algorithm type of the public key: if the public key is of type "DSA" then the algorithm "SHA1withDSA" is used, in case of an "RSA" key it is "MD5withRSA". Keys generated with the keytool for the standard Java 2 keystore are of type "DSA" if not specified otherwise. The creation of certificates has to be performed by a third party tool, such as the ones provided with OpenSSL.

The JCE signing engine that is used can not be specified for the moment, this class simply uses the first available one.

To repeat: It is up to the user of this class to assign trust to such an extension, this class can only be used to transfer an extension secured from unnoticed changes.

Remark: to simplify the security auditing of this class, the necessary and constant parameters are passed to the constructor and no additional setter-methods are available.
version:
   $Revision: 1.1.1.1 $
author:
   Marcel Muller



Field Summary
transient  booleanverified
    
transient  AspectwrappedExtension
    

Constructor Summary
public  SignedAspect(Aspect extension, KeyPair keys)
     Constructs a signed extension and protects it from being modified unnoticed.

Method Summary
protected  Crosscut[]crosscuts()
    
public  booleanequals(Object o)
    
public  ListgetCrosscuts()
    
public  AspectgetExtension()
     Returns wrapped extension without checking it for being signed by a key corresponding to the public key stored.
public  PublicKeygetPublicKey()
    
public  StringgetSigningAlgorithm()
    
public  inthashCode()
    
public  voidinsertionAction(boolean beforeInsertion)
    
public static  SignedAspectsignExtension(Aspect ext)
     Convinience method to sign extensions.
public  StringtoString()
    
public  voidverifyExtension()
     Verifies that the public key stored in this object corresponds to the private key used to sign the extension.
public  voidwithdrawalAction(boolean beforeWithdrawal)
    

Field Detail
verified
transient boolean verified(Code)



wrappedExtension
transient Aspect wrappedExtension(Code)




Constructor Detail
SignedAspect
public SignedAspect(Aspect extension, KeyPair keys)(Code)
Constructs a signed extension and protects it from being modified unnoticed. Only the public key from the key pair passed is store in the generated object.
Parameters:
  extension - the extension to be wrapped into a SignedObject
Parameters:
  keys - the key pair used to sign and verify the extension




Method Detail
crosscuts
protected Crosscut[] crosscuts()(Code)



equals
public boolean equals(Object o)(Code)
Delegate to wrapped extension



getCrosscuts
public List getCrosscuts()(Code)



getExtension
public Aspect getExtension()(Code)
Returns wrapped extension without checking it for being signed by a key corresponding to the public key stored. the wrapped extension



getPublicKey
public PublicKey getPublicKey()(Code)
Returns public key that possibly corresponds to signing key the public key passed in the constructor



getSigningAlgorithm
public String getSigningAlgorithm()(Code)
Returns signing algorithm name the algorithm name



hashCode
public int hashCode()(Code)
delegate to wrapped extension



insertionAction
public void insertionAction(boolean beforeInsertion) throws AspectInsertionException(Code)



signExtension
public static SignedAspect signExtension(Aspect ext)(Code)
Convinience method to sign extensions. Throws IllegalStateException if signing is not possible.

FIX: CONTAINS A LOT OF HARD CODED STUFF!!!!




toString
public String toString()(Code)
Implementation: we don't use getExtension() here, as we don't want to de-marshall extension just because of the toString call



verifyExtension
public void verifyExtension() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException(Code)
Verifies that the public key stored in this object corresponds to the private key used to sign the extension.
throws:
  NoSuchAlgorithmException -
throws:
  SignatureException -
throws:
  InvalidKeyException -



withdrawalAction
public void withdrawalAction(boolean beforeWithdrawal)(Code)



Fields inherited from ch.ethz.prose.Aspect
protected Object aspectID(Code)(Java Doc)
protected static long birthDayCount(Code)(Java Doc)
protected int priority(Code)(Java Doc)

Methods inherited from ch.ethz.prose.Aspect
public synchronized void associateTo(Object id)(Code)(Java Doc)
abstract protected Crosscut[] crosscuts()(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public static Object generateUniqueAssociation()(Code)(Java Doc)
public Object getAssociatedObject()(Code)(Java Doc)
public List getCrosscuts()(Code)(Java Doc)
public int getPriority()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public void insertionAction(boolean isBefore)(Code)(Java Doc)
public void setPriority(int prio)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public void withdrawalAction(boolean isBefore)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.