|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FIM.payment.PaymentBase
A helper class with common methods of interface Payment
implemented.
Invoice
, Serialized FormConstructor Summary | |
protected |
PaymentBase()
Create a new empty object. |
|
PaymentBase(Invoice inv,
String characteristic)
Create a new payment object with a characteristic. |
Method Summary | |
String |
characteristics()
Retrieve the characteristic string for this type of payment (description of the content) |
void |
decodeXMLElement(Element elem)
Parse back the payment from an XML element. |
Serializable |
getAsSerializable()
Retrieve the payment as a serializable (just returns this as this object is directly serializable). |
Element |
getAsXMLElement(Document doc)
Retrieve the payment as an XML element. |
Certificate |
getCertificate()
Retrieve the certificate passed in upon signing. |
byte[] |
getEncoded()
Retrieve the payment in encoded form to be used for signing. |
Invoice |
getInvoice()
Retrieve the invoice this payment is for. |
boolean |
isSigned()
Check whether this payment is signed or not. |
void |
sign(String signAlgorithm,
PrivateKey pk,
Certificate cert)
Sign the payment. |
void |
verifySignature(String provider)
Verify the signature of the payment based on the certificate contained. |
void |
verifySignature(String provider,
PublicKey pk)
Verify the signature of the payment based on the public key passed in. |
Methods inherited from class java.lang.Object |
|
Methods inherited from interface FIM.payment.Payment |
toString |
Constructor Detail |
public PaymentBase(Invoice inv, String characteristic)
invoice
- the invoice this payment is forcharacteristic
- the description of the contentstringData
- the string dataprotected PaymentBase()
Method Detail |
public Invoice getInvoice()
getInvoice
in interface Payment
public Certificate getCertificate()
null
if non provided then.getCertificate
in interface Payment
null
public boolean isSigned()
isSigned
in interface Payment
true
if the payment is signedpublic void sign(String signAlgorithm, PrivateKey pk, Certificate cert) throws InvalidKeyException, NoSuchAlgorithmException
sign
in interface Payment
signAlgorithm
- the algorithm to be used for signingpk
- the private key to be used for signingcert
- the certificate of the public key associated with the private key (can be null
)InvalidKeyException
- if the private key is invalidNoSuchAlgorithmException
- if the algorithm is not supportedpublic void verifySignature(String provider) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
verifySignature
in interface Payment
provider
- the security provider to be used for checking. if null
, the standard provider is usedInvalidKeyException
- if the public key is invalidNoSuchAlgorithmException
- if the algorithm used for signing is not supportedInvalidKeyException
- if the key in the certificate is erroneousNoSuchProviderException
- if the security provider could not be foundSignatureException
- if the signature is invalidpublic void verifySignature(String provider, PublicKey pk) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
verifySignature
in interface Payment
provider
- the security provider to be used for checking. if null
, the standard provider is usedpk
- the public key to use for verification. If null
, the key from the certificate is used (if no certificate in this case, verification fails)NoSuchAlgorithmException
- if the algorithm used for signing is not supportedInvalidKeyException
- if the public key (or the key in the certificate) is invalidNoSuchProviderException
- if the security provider could not be foundSignatureException
- if the signature is invalidpublic byte[] getEncoded()
getEncoded
in interface Payment
public String characteristics()
characteristics
in interface Payment
public Serializable getAsSerializable()
this
as this object is directly serializable).getAsSerializable
in interface XMLEncodeable
public Element getAsXMLElement(Document doc)
getAsXMLElement
in interface XMLEncodeable
doc
- the document within which to create the elementpublic void decodeXMLElement(Element elem) throws IllegalArgumentException
decodeXMLElement
in interface XMLEncodeable
elem
- the element containing the currency to parse backIllegalArgumentException
- if the element is incorrect (e. g. wrong tag name)
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |