Java Doc for ValueLinkApi.java in  » ERP-CRM-Financial » SourceTap-CRM » org » ofbiz » accounting » thirdparty » valuelink » 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 » ERP CRM Financial » SourceTap CRM » org.ofbiz.accounting.thirdparty.valuelink 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ofbiz.accounting.thirdparty.valuelink.ValueLinkApi

ValueLinkApi
public class ValueLinkApi (Code)
ValueLinkApi - Implementation of ValueLink Encryption & Transport
author:
   Andy Zeneski
version:
   $Revision: 1.6 $
since:
   3.0


Field Summary
protected  booleandebug
    
protected  GenericDelegatordelegator
    
protected  SecretKeykek
    
protected  StringmerchantId
    
final public static  Stringmodule
    
protected  SecretKeymwk
    
protected  LongmwkIndex
    
protected  Propertiesprops
    
protected  StringterminalId
    

Constructor Summary
protected  ValueLinkApi()
    
protected  ValueLinkApi(GenericDelegator delegator, Properties props)
    

Method Summary
public static  byte[]copyBytes(byte[] source, byte[] target, int position)
    
public  KeyPaircreateKeys()
    
protected  byte[]cryptoViaKek(byte[] content, int mode)
    
public  StringdecryptPin(String pin)
    
public  byte[]decryptViaKek(byte[] content)
    
public  StringencryptPin(String pin)
    
public  byte[]encryptViaKek(byte[] content)
    
public  byte[]generateKek(PrivateKey privateKey)
    
public  byte[]generateMwk()
    
public  byte[]generateMwk(byte[] desBytes)
    
public  byte[]generateMwk(SecretKey mwkdes3)
    
public  StringgetAmount(Double amount)
    
public  DoublegetAmount(String amount)
    
public static  byte[]getByteRange(byte[] bytes, int offset, int length)
    
protected  CiphergetCipher(SecretKey key, int mode)
    
public  StringgetCurrency(String currency)
    
protected  DHParameterSpecgetDHParameterSpec()
    
public  StringgetDateString()
    
protected  SecretKeygetDesEdeKey(byte[] rawKey)
    
public  GenericValuegetGenericValue()
    
public  MapgetInitialRequestMap(Map context)
    
public static  ValueLinkApigetInstance(GenericDelegator delegator, Properties props, boolean reload)
    
public static  ValueLinkApigetInstance(GenericDelegator delegator, Properties props)
    
protected  byte[]getKek()
    
protected  SecretKeygetKekKey()
    
protected  byte[]getMwk()
    
protected  SecretKeygetMwkKey()
    
protected  byte[]getPinCheckSum(byte[] pinBytes)
    
public  PrivateKeygetPrivateKey()
    
protected  byte[]getPrivateKeyBytes()
    
protected  byte[]getRandomBytes(int length)
    
public  PublicKeygetValueLinkPublicKey()
    
public  LonggetWorkingKeyIndex()
    
public  StringBufferoutputKeyCreation(boolean kekOnly, String kekTest)
    
protected  MapparseResponse(String response)
    
public  voidreload()
    
public  Mapsend(Map request)
    
public  Mapsend(String url, Map request)
    

Field Detail
debug
protected boolean debug(Code)



delegator
protected GenericDelegator delegator(Code)



kek
protected SecretKey kek(Code)



merchantId
protected String merchantId(Code)



module
final public static String module(Code)



mwk
protected SecretKey mwk(Code)



mwkIndex
protected Long mwkIndex(Code)



props
protected Properties props(Code)



terminalId
protected String terminalId(Code)




Constructor Detail
ValueLinkApi
protected ValueLinkApi()(Code)



ValueLinkApi
protected ValueLinkApi(GenericDelegator delegator, Properties props)(Code)




Method Detail
copyBytes
public static byte[] copyBytes(byte[] source, byte[] target, int position)(Code)
Copies a byte[] into another byte[] starting at a specific position
Parameters:
  source - byte[] to copy from
Parameters:
  target - byte[] coping into
Parameters:
  position - the position on target where source will be copied to a new byte[]



createKeys
public KeyPair createKeys() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeySpecException(Code)
Create a set of public/private keys using ValueLinks defined parameters KeyPair object containing both public and private keys
throws:
  NoSuchAlgorithmException -
throws:
  InvalidAlgorithmParameterException -



cryptoViaKek
protected byte[] cryptoViaKek(byte[] content, int mode)(Code)



decryptPin
public String decryptPin(String pin)(Code)
Decrypt an encrypted pin using the configured keys
Parameters:
  pin - Hex String of the encrypted pin (EAN) Plain text String of the pin



decryptViaKek
public byte[] decryptViaKek(byte[] content)(Code)
Ue the KEK to decrypt a value
Parameters:
  content - byte array to decrypt decrypted byte array



encryptPin
public String encryptPin(String pin)(Code)
Encrypt the defined pin using the configured keys
Parameters:
  pin - Plain text String of the pin Hex String of the encrypted pin (EAN) for transmission to ValueLink



encryptViaKek
public byte[] encryptViaKek(byte[] content)(Code)
Use the KEK to encrypt a value usually the MWK
Parameters:
  content - byte array to encrypt encrypted byte array



generateKek
public byte[] generateKek(PrivateKey privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException(Code)
Generate a key exchange key for use in encrypting the mwk
Parameters:
  privateKey - The private key for the merchant byte array containing the kek
throws:
  NoSuchAlgorithmException -
throws:
  InvalidKeySpecException -
throws:
  InvalidKeyException -



generateMwk
public byte[] generateMwk()(Code)
Generate a new MWK Hex String of the new encrypted MWK ready for transmission to ValueLink



generateMwk
public byte[] generateMwk(byte[] desBytes)(Code)
Generate a new MWK
Parameters:
  desBytes - byte array of the DES key (24 bytes) Hex String of the new encrypted MWK ready for transmission to ValueLink



generateMwk
public byte[] generateMwk(SecretKey mwkdes3)(Code)
Generate a new MWK
Parameters:
  mwkdes3 - pre-generated DES3 SecretKey Hex String of the new encrypted MWK ready for transmission to ValueLink



getAmount
public String getAmount(Double amount)(Code)
Returns a ValueLink formatted amount String
Parameters:
  amount - Double value to format Formatted String



getAmount
public Double getAmount(String amount)(Code)
Returns a Double from a ValueLink formatted amount String
Parameters:
  amount - The ValueLink formatted amount String Double object



getByteRange
public static byte[] getByteRange(byte[] bytes, int offset, int length)(Code)
Returns a new byte[] from the offset of the defined byte[] with a specific number of bytes
Parameters:
  bytes - The byte[] to extract from
Parameters:
  offset - The starting postition
Parameters:
  length - The number of bytes to copy a new byte[]



getCipher
protected Cipher getCipher(SecretKey key, int mode)(Code)



getCurrency
public String getCurrency(String currency)(Code)



getDHParameterSpec
protected DHParameterSpec getDHParameterSpec()(Code)



getDateString
public String getDateString()(Code)
Returns a date string formatted as directed by ValueLink ValueLink formatted date String



getDesEdeKey
protected SecretKey getDesEdeKey(byte[] rawKey)(Code)



getGenericValue
public GenericValue getGenericValue()(Code)
Gets the cached value object for this merchant's keys Cached GenericValue object



getInitialRequestMap
public Map getInitialRequestMap(Map context)(Code)
Creates a Map of initial request values (MerchID, AltMerchNo, Modes, MerchTime, TermTxnNo, EncryptID) Note: For 2010 (assign working key) transaction, the EncryptID will need to be adjusted Map containing the inital request values



getInstance
public static ValueLinkApi getInstance(GenericDelegator delegator, Properties props, boolean reload)(Code)
Obtain an instance of the ValueLinkApi
Parameters:
  delegator - GenericDelegator used to query the encryption keys
Parameters:
  props - Properties to use for the Api (usually payment.properties)
Parameters:
  reload - When true, will replace an existing instance in the cache and reload all properties ValueLinkApi reference



getInstance
public static ValueLinkApi getInstance(GenericDelegator delegator, Properties props)(Code)
Obtain an instance of the ValueLinkApi; this method will always return an existing reference if one is available
Parameters:
  delegator - GenericDelegator used to query the encryption keys
Parameters:
  props - Properties to use for the Api (usually payment.properties)



getKek
protected byte[] getKek()(Code)



getKekKey
protected SecretKey getKekKey()(Code)



getMwk
protected byte[] getMwk()(Code)



getMwkKey
protected SecretKey getMwkKey()(Code)



getPinCheckSum
protected byte[] getPinCheckSum(byte[] pinBytes)(Code)



getPrivateKey
public PrivateKey getPrivateKey() throws InvalidKeySpecException, NoSuchAlgorithmException(Code)
Get merchant Private Key PrivateKey object for the merchant



getPrivateKeyBytes
protected byte[] getPrivateKeyBytes()(Code)



getRandomBytes
protected byte[] getRandomBytes(int length)(Code)



getValueLinkPublicKey
public PublicKey getValueLinkPublicKey() throws NoSuchAlgorithmException, InvalidKeySpecException(Code)
Get a public key object for the ValueLink supplied public key PublicKey object of ValueLinks's public key
throws:
  NoSuchAlgorithmException -
throws:
  InvalidKeySpecException -



getWorkingKeyIndex
public Long getWorkingKeyIndex()(Code)
Returns the current working key index Long number of the current working key index



outputKeyCreation
public StringBuffer outputKeyCreation(boolean kekOnly, String kekTest)(Code)
Output the creation of public/private keys + KEK to the console for manual database update



parseResponse
protected Map parseResponse(String response)(Code)



reload
public void reload()(Code)
Reloads the keys in the object cache; use this when re-creating keys



send
public Map send(Map request) throws HttpClientException(Code)
Transmit a request to ValueLink
Parameters:
  request - Map of request parameters Map of response parameters
throws:
  HttpClientException -



send
public Map send(String url, Map request) throws HttpClientException(Code)
Transmit a request to ValueLink
Parameters:
  url - override URL from what is defined in the properties
Parameters:
  request - request Map of request parameters Map of response parameters
throws:
  HttpClientException -



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.