mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 18:59:39 +02:00
Bump sop-java to 10.0.0-SNAPSHOT and implement sopv interface subset
This commit is contained in:
parent
fa5bdfcd82
commit
3ac273757a
5 changed files with 59 additions and 3 deletions
|
@ -0,0 +1,40 @@
|
|||
// SPDX-FileCopyrightText: 2024 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.sop;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.pgpainless.util.ArmoredOutputStreamFactory;
|
||||
import sop.SOPV;
|
||||
import sop.operation.DetachedVerify;
|
||||
import sop.operation.InlineVerify;
|
||||
import sop.operation.Version;
|
||||
|
||||
/**
|
||||
* Implementation of the <pre>sopv</pre> interface subset using PGPainless.
|
||||
*/
|
||||
public class SOPVImpl implements SOPV {
|
||||
|
||||
static {
|
||||
ArmoredOutputStreamFactory.setVersionInfo(null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public DetachedVerify detachedVerify() {
|
||||
return new DetachedVerifyImpl();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public InlineVerify inlineVerify() {
|
||||
return new InlineVerifyImpl();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Version version() {
|
||||
return new VersionImpl();
|
||||
}
|
||||
}
|
|
@ -10,6 +10,8 @@ import java.util.Locale;
|
|||
import java.util.Properties;
|
||||
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import sop.exception.SOPGPException;
|
||||
import sop.operation.Version;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
@ -20,7 +22,9 @@ import javax.annotation.Nonnull;
|
|||
public class VersionImpl implements Version {
|
||||
|
||||
// draft version
|
||||
private static final int SOP_VERSION = 8;
|
||||
private static final int SOP_VERSION = 10;
|
||||
|
||||
private static final String SOPV_VERSION = "1.0";
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
|
@ -86,4 +90,9 @@ public class VersionImpl implements Version {
|
|||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getSopVVersion() throws SOPGPException.UnsupportedOption {
|
||||
return SOPV_VERSION;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,4 +72,11 @@ public class VersionTest {
|
|||
assertTrue(fullSopSpecVersion.endsWith(incompletenessRemarks));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSopVVersion() {
|
||||
String sopVVersion = sop.version().getSopVVersion();
|
||||
assertNotNull(sopVVersion);
|
||||
assertTrue(sopVVersion.matches("\\d+\\.\\d+(\\.\\d+)*")); // X.Y or X.Y.Z... etc.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue