|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class representing the payment for a certain invoice. The actual payment information is implementation specific. The payment can be signed.
Invoice
Method Summary | |
String |
characteristics()
Retrieve a characteristic string for this type of payment (e. g. |
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. |
String |
toString()
Retrieve the payment as a string, suitable for presenting to the user in a very simple form. |
void |
verifySignature(String provider)
Verify the signature of the invoice based on the certificate contained. |
void |
verifySignature(String provider,
PublicKey pk)
Verify the signature of the invoice based on the public key passed in. |
Methods inherited from interface FIM.Util.XML.XMLEncodeable |
decodeXMLElement, getAsSerializable, getAsXMLElement |
Method Detail |
public Invoice getInvoice()
public boolean isSigned()
true
if the payment is signedpublic void sign(String signAlgorithm, PrivateKey pk, Certificate cert) throws InvalidKeyException, NoSuchAlgorithmException
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 Certificate getCertificate()
null
if non provided then.null
public void verifySignature(String provider) throws NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
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
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 String characteristics()
public byte[] getEncoded()
public String toString()
toString
in interface XMLEncodeable
toString
in class Object
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |