|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class models an invoice to another entity. It might be signed. Can be encoded in XML. Contains the date, a title, and the items.
InvoiceItem
Method Summary | |
Certificate |
getCertificate()
Retrieve the certificate passed in upon signing. |
Date |
getDate()
Retrieve the date of the invoice. |
byte[] |
getEncoded()
Retrieve the invoice in encoded form to be used for signing. |
String |
getIssuer()
Retrieve the issuer of the invoice as a string. |
Certificate |
getIssuerCertificate()
Retrieve the issuer of the invoice as a certificate (might be null ). |
InvoiceItem[] |
getItems()
Retrieve the items contained within the invoice (items or lines). |
String |
getTitle()
Retrieve the title of the invoice. |
Price |
getTotalPrice()
Retrieve the total value of all items in the invoice. |
boolean |
isSigned()
Check whether this invoice is signed or not. |
void |
sign(String signAlgorithm,
PrivateKey pk,
Certificate cert)
Sign the invoice. |
String |
toString()
Retrieve the invoice 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 Date getDate()
public String getTitle()
public InvoiceItem[] getItems()
public Price getTotalPrice()
public String getIssuer()
public Certificate getIssuerCertificate()
null
).null
public boolean isSigned()
true
if the invoice 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 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 |