-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from silegis-mg/silegismg
XAdES-X-L and a XAdES-A support
- Loading branch information
Showing
146 changed files
with
11,521 additions
and
983 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/xades4j/production/DataGenAttrAuthoritiesCertValues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* XAdES4j - A Java library for generation and verification of XAdES signatures. | ||
* Copyright (C) 2012 Hubert Kario - QBS. | ||
* | ||
* XAdES4j is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 3 of the License, or any later version. | ||
* | ||
* XAdES4j is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License along | ||
* with XAdES4j. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package xades4j.production; | ||
|
||
import java.security.cert.CertificateEncodingException; | ||
import java.security.cert.X509Certificate; | ||
|
||
import xades4j.properties.AttrAuthoritiesCertValuesProperty; | ||
import xades4j.properties.data.AttrAuthoritiesCertValuesData; | ||
import xades4j.properties.data.CertificateValuesData; | ||
import xades4j.properties.data.PropertyDataObject; | ||
|
||
/** | ||
* @author Hubert Kario | ||
*/ | ||
public class DataGenAttrAuthoritiesCertValues | ||
implements PropertyDataObjectGenerator<AttrAuthoritiesCertValuesProperty> | ||
{ | ||
@Override | ||
public PropertyDataObject generatePropertyData( | ||
AttrAuthoritiesCertValuesProperty prop, | ||
PropertiesDataGenerationContext ctx) | ||
throws PropertyDataGenerationException | ||
{ | ||
AttrAuthoritiesCertValuesData attrAuthCertValuesData = | ||
new AttrAuthoritiesCertValuesData(); | ||
try | ||
{ | ||
for (X509Certificate cer : prop.getCertificates()) | ||
{ | ||
attrAuthCertValuesData.addData(cer.getEncoded()); | ||
} | ||
} catch (CertificateEncodingException ex) | ||
{ | ||
throw new PropertyDataGenerationException(prop, "cannot get encoded certificate", ex); | ||
} | ||
|
||
return attrAuthCertValuesData; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/xades4j/production/DataGenAttributeRevocationValues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* XAdES4j - A Java library for generation and verification of XAdES signatures. | ||
* Copyright (C) 2012 Hubert Kario - QBS | ||
* | ||
* XAdES4j is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 3 of the License, or any later version. | ||
* | ||
* XAdES4j is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License along | ||
* with XAdES4j. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package xades4j.production; | ||
|
||
import java.security.cert.CRLException; | ||
import java.security.cert.X509CRL; | ||
|
||
import xades4j.properties.AttributeRevocationValuesProperty; | ||
import xades4j.properties.data.AttributeRevocationValuesData; | ||
import xades4j.properties.data.PropertyDataObject; | ||
|
||
/** | ||
* | ||
* @author Hubert Kario | ||
* | ||
*/ | ||
public class DataGenAttributeRevocationValues implements | ||
PropertyDataObjectGenerator<AttributeRevocationValuesProperty> | ||
{ | ||
@Override | ||
public PropertyDataObject generatePropertyData( | ||
AttributeRevocationValuesProperty prop, | ||
PropertiesDataGenerationContext ctx) | ||
throws PropertyDataGenerationException | ||
{ | ||
AttributeRevocationValuesData attrRevocValuesData = new AttributeRevocationValuesData(); | ||
try | ||
{ | ||
for (X509CRL crl : prop.getCrls()) | ||
{ | ||
attrRevocValuesData.addData(crl.getEncoded()); | ||
} | ||
} catch (CRLException ex) | ||
{ | ||
throw new PropertyDataGenerationException(prop, "cannot get encoded CRL", ex); | ||
} | ||
return attrRevocValuesData; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
src/main/java/xades4j/production/DataGenTimeStampValidationData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* XAdES4j - A Java library for generation and verification of XAdES signatures. | ||
* Copyright (C) 2012 Hubert Kario - QBS. | ||
* | ||
* XAdES4j is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 3 of the License, or any later version. | ||
* | ||
* XAdES4j is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License along | ||
* with XAdES4j. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package xades4j.production; | ||
|
||
import java.security.cert.CRLException; | ||
import java.security.cert.CertificateEncodingException; | ||
import java.security.cert.X509CRL; | ||
import java.security.cert.X509Certificate; | ||
|
||
import xades4j.properties.TimeStampValidationDataProperty; | ||
import xades4j.properties.data.PropertyDataObject; | ||
import xades4j.properties.data.TimeStampValidationDataData; | ||
|
||
/** | ||
* | ||
* @author Hubert Kario | ||
* | ||
*/ | ||
public class DataGenTimeStampValidationData implements | ||
PropertyDataObjectGenerator<TimeStampValidationDataProperty> | ||
{ | ||
|
||
@Override | ||
public PropertyDataObject generatePropertyData( | ||
TimeStampValidationDataProperty prop, | ||
PropertiesDataGenerationContext ctx) | ||
throws PropertyDataGenerationException | ||
{ | ||
TimeStampValidationDataData tsValidationDataData = | ||
new TimeStampValidationDataData(); | ||
|
||
try | ||
{ | ||
for (X509Certificate cer : prop.getCertificates()) | ||
{ | ||
tsValidationDataData.addCertificateData(cer.getEncoded()); | ||
} | ||
} catch (CertificateEncodingException e) | ||
{ | ||
throw new PropertyDataGenerationException(prop, "cannot get encoded certificate", e); | ||
} | ||
|
||
try | ||
{ | ||
for (X509CRL crl : prop.getCrls()) | ||
{ | ||
tsValidationDataData.addCRLData(crl.getEncoded()); | ||
} | ||
} catch (CRLException e) | ||
{ | ||
throw new PropertyDataGenerationException(prop, "cannot get encoded CRL", e); | ||
} | ||
|
||
return tsValidationDataData; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.