generated from sentrysoftware/oss-maven-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #5 from sentrysoftware/feature/issue-4-develop-snm…
…p-library Feature/issue 4 develop snmp library
- Loading branch information
Showing
143 changed files
with
37,049 additions
and
63 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
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 |
---|---|---|
|
@@ -2,18 +2,18 @@ | |
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.sentrysoftware</groupId> | ||
<artifactId>MYARTIFACT</artifactId> | ||
<name>MY PROJECT</name> | ||
<version>0.1.00-SNAPSHOT</version> | ||
<description>SOME DESCRIPTION</description> | ||
<packaging>jar</packaging> | ||
<artifactId>snmp</artifactId> | ||
<name>SNMP Java Client</name> | ||
<version>1.0.00-SNAPSHOT</version> | ||
<description>SNMP Client Library for Java</description> | ||
<packaging>jar</packaging> | ||
|
||
<organization> | ||
<name>Sentry Software</name> | ||
<url>https://sentrysoftware.com</url> | ||
</organization> | ||
|
||
<url>https://github.com/sentrysoftware/MYREPO</url> | ||
<url>https://sentrysoftware.github.io/snmp</url> | ||
<inceptionYear>2023</inceptionYear> | ||
|
||
<distributionManagement> | ||
|
@@ -29,37 +29,56 @@ | |
|
||
<licenses> | ||
<license> | ||
<name>Apache-2.0</name> | ||
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<name>LGPL-3.0</name> | ||
<url>https://www.gnu.org/licenses/lgpl+gpl-3.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<issueManagement> | ||
<system>GitHub</system> | ||
<url>https://github.com/sentrysoftware/MYREPO/issues/</url> | ||
<url>https://github.com/sentrysoftware/snmp/issues/</url> | ||
</issueManagement> | ||
|
||
<scm> | ||
<connection>scm:git:https://github.com/sentrysoftware/MYREPO.git</connection> | ||
<url>https://github.com/sentrysoftware/MYREPO</url> | ||
<connection>scm:git:https://github.com/sentrysoftware/snmp.git</connection> | ||
<url>https://sentrysoftware.github.io/snmp</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<developers> | ||
<developer> | ||
<name>MY NAME (@MY_ID)</name> | ||
<email>MYNAME@sentrysoftware.com</email> | ||
<name>Bertrand Martin (@bertysentry)</name> | ||
<email>bertrand@sentrysoftware.com</email> | ||
<roles> | ||
<role>Project founder</role> | ||
<role>maintainer</role> | ||
</roles> | ||
</developer> | ||
<developer> | ||
<name>Nassim Boutekedjiret (@NassimBtk)</name> | ||
<email>[email protected]</email> | ||
<roles> | ||
<role>maintainer</role> | ||
</roles> | ||
</developer> | ||
<developer> | ||
<name>Kawtar Bakour (@KawtarBK9)</name> | ||
<email>[email protected]</email> | ||
<roles> | ||
<role>maintainer</role> | ||
</roles> | ||
</developer> | ||
<developer> | ||
<name>Elyes Cherfa (@CherfaElyes)</name> | ||
<email>[email protected]</email> | ||
<roles> | ||
<role>maintainer</role> | ||
</roles> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<!-- Java 11 --> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
<maven.compiler.release>11</maven.compiler.release> | ||
|
||
<!-- UTF-8 --> | ||
|
@@ -153,7 +172,7 @@ | |
<artifactId>license-maven-plugin</artifactId> | ||
<version>2.3.0</version> | ||
<configuration> | ||
<licenseName>apache_v2</licenseName> | ||
<licenseName>lgpl_v3</licenseName> | ||
<copyrightOwners>Sentry Software</copyrightOwners> | ||
<copyrightStringFormat>Copyright %1$s %2$s</copyrightStringFormat> | ||
<includes> | ||
|
@@ -183,6 +202,9 @@ | |
<!-- javadoc --> | ||
<plugin> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<configuration> | ||
<doclint>all,-missing</doclint> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>attach-javadocs</id> | ||
|
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,78 @@ | ||
package org.bouncycastle.crypto; | ||
|
||
/*- | ||
* ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ | ||
* SNMP Java Client | ||
* ჻჻჻჻჻჻ | ||
* Copyright 2023 Sentry Software, Westhawk | ||
* ჻჻჻჻჻჻ | ||
* This program 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 (at your option) any later version. | ||
* | ||
* This program 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 General Lesser Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Lesser Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/lgpl-3.0.html>. | ||
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱ | ||
*/ | ||
|
||
|
||
/** | ||
* Block cipher engines are expected to conform to this interface. | ||
*/ | ||
public interface BlockCipher | ||
{ | ||
/** | ||
* Initialise the cipher. | ||
* | ||
* @param forEncryption if true the cipher is initialised for | ||
* encryption, if false for decryption. | ||
* @param params the key and other data required by the cipher. | ||
* @exception IllegalArgumentException if the params argument is | ||
* inappropriate. | ||
*/ | ||
public void init(boolean forEncryption, CipherParameters params) | ||
throws IllegalArgumentException; | ||
|
||
/** | ||
* Return the name of the algorithm the cipher implements. | ||
* | ||
* @return the name of the algorithm the cipher implements. | ||
*/ | ||
public String getAlgorithmName(); | ||
|
||
/** | ||
* Return the block size for this cipher (in bytes). | ||
* | ||
* @return the block size for this cipher in bytes. | ||
*/ | ||
public int getBlockSize(); | ||
|
||
/** | ||
* Process one block of input from the array in and write it to | ||
* the out array. | ||
* | ||
* @param in the array containing the input data. | ||
* @param inOff offset into the in array the data starts at. | ||
* @param out the array the output data will be copied into. | ||
* @param outOff the offset into the out array the output will start at. | ||
* @exception DataLengthException if there isn't enough data in in, or | ||
* space in out. | ||
* @exception IllegalStateException if the cipher isn't initialised. | ||
* @return the number of bytes processed and produced. | ||
*/ | ||
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) | ||
throws DataLengthException, IllegalStateException; | ||
|
||
/** | ||
* Reset the cipher. After resetting the cipher is in the same state | ||
* as it was after the last init (if there was one). | ||
*/ | ||
public void reset(); | ||
} |
60 changes: 60 additions & 0 deletions
60
src/main/java/org/bouncycastle/crypto/CipherKeyGenerator.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,60 @@ | ||
package org.bouncycastle.crypto; | ||
|
||
/*- | ||
* ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ | ||
* SNMP Java Client | ||
* ჻჻჻჻჻჻ | ||
* Copyright 2023 Sentry Software, Westhawk | ||
* ჻჻჻჻჻჻ | ||
* This program 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 (at your option) any later version. | ||
* | ||
* This program 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 General Lesser Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Lesser Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/lgpl-3.0.html>. | ||
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱ | ||
*/ | ||
|
||
import java.security.SecureRandom; | ||
|
||
/** | ||
* The base class for symmetric, or secret, cipher key generators. | ||
*/ | ||
public class CipherKeyGenerator | ||
{ | ||
protected SecureRandom random; | ||
protected int strength; | ||
|
||
/** | ||
* initialise the key generator. | ||
* | ||
* @param param the parameters to be used for key generation | ||
*/ | ||
public void init( | ||
KeyGenerationParameters param) | ||
{ | ||
this.random = param.getRandom(); | ||
this.strength = (param.getStrength() + 7) / 8; | ||
} | ||
|
||
/** | ||
* generate a secret key. | ||
* | ||
* @return a byte array containing the key value. | ||
*/ | ||
public byte[] generateKey() | ||
{ | ||
byte[] key = new byte[strength]; | ||
|
||
random.nextBytes(key); | ||
|
||
return key; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/org/bouncycastle/crypto/CipherParameters.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,30 @@ | ||
package org.bouncycastle.crypto; | ||
|
||
/*- | ||
* ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ | ||
* SNMP Java Client | ||
* ჻჻჻჻჻჻ | ||
* Copyright 2023 Sentry Software, Westhawk | ||
* ჻჻჻჻჻჻ | ||
* This program 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 (at your option) any later version. | ||
* | ||
* This program 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 General Lesser Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Lesser Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/lgpl-3.0.html>. | ||
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱ | ||
*/ | ||
|
||
/** | ||
* all parameter classes implement this. | ||
*/ | ||
public interface CipherParameters | ||
{ | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/org/bouncycastle/crypto/DataLengthException.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,51 @@ | ||
package org.bouncycastle.crypto; | ||
|
||
/*- | ||
* ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ | ||
* SNMP Java Client | ||
* ჻჻჻჻჻჻ | ||
* Copyright 2023 Sentry Software, Westhawk | ||
* ჻჻჻჻჻჻ | ||
* This program 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 (at your option) any later version. | ||
* | ||
* This program 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 General Lesser Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Lesser Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/lgpl-3.0.html>. | ||
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱ | ||
*/ | ||
|
||
/** | ||
* this exception is thrown if a buffer that is meant to have output | ||
* copied into it turns out to be too short, or if we've been given | ||
* insufficient input. In general this exception will get thrown rather | ||
* than an ArrayOutOfBounds exception. | ||
*/ | ||
public class DataLengthException | ||
extends RuntimeCryptoException | ||
{ | ||
/** | ||
* base constructor. | ||
*/ | ||
public DataLengthException() | ||
{ | ||
} | ||
|
||
/** | ||
* create a DataLengthException with the given message. | ||
* | ||
* @param message the message to be carried with the exception. | ||
*/ | ||
public DataLengthException( | ||
String message) | ||
{ | ||
super(message); | ||
} | ||
} |
Oops, something went wrong.