This file contains hidden or 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
import json | |
from asn1crypto import pem, keys | |
with open('components/key.pub', 'rb') as f: | |
der_bytes = f.read() | |
if pem.detect(der_bytes): | |
type_name,headers,decoded_bytes = pem.unarmor(der_bytes) | |
key = keys.PublicKeyInfo.load(decoded_bytes) |
This file contains hidden or 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
import subprocess | |
content="test" | |
command = [ | |
"openssl", "smime", | |
"-binary", | |
"-sign", | |
"-certfile", '/home/sri/IdeaProjects/pk2/components/wwdr.pem', | |
"-signer", '/home/sri/IdeaProjects/pk2/components/com.ndudfield.nfc.pem', |
This file contains hidden or 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
import json | |
from asn1crypto import pem, x509 | |
with open('key.pub', 'rb') as f: | |
der_bytes = f.read() | |
if pem.detect(der_bytes): | |
type_name,headers,decoded_bytes = pem.unarmor(der_bytes) | |
cert = x509.Certificate.load(decoded_bytes) | |
print(type_name) |
This file contains hidden or 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
public void displayInfo() { | |
System.out.println("COLLEGE EMPLOYEE DETAILS"); | |
System.out.println("========================"); | |
super.displayInfo(); | |
System.out.println("Social Security Number: \t" + socialSecurityNo); | |
System.out.println("Salary: \t\t\t" + salary); | |
System.out.println("Department Name: \t\t" + deptName); |
This file contains hidden or 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
package collegelist; | |
import java.util.*; | |
//import java.io.*; | |
/** | |
* Java Assignment 3, part 3 | |
* @author Oliver Keefe | |
*/ | |
public class CollegeList { | |
public static void main(String[] args) { |
This file contains hidden or 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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package collegelist; | |
public class Person { | |
private String firstName, lastName, streetAddress; | |
private int postCode, phoneNumber; | |
This file contains hidden or 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
public static boolean codeExists(ArrayList subjectList, String userCode){ | |
boolean exists = false; | |
for(int i=0; i < subjectList.size(); i++){ | |
String iCode = ((Subject)subjectList.get(i)).getCode(); | |
if(userCode.matches(iCode)){ | |
exists = true; | |
} | |
} | |
return exists; | |
} |
This file contains hidden or 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
Develop a set of classes for a college to use in various student service and personnel applications. Classes you need to design include following: | |
• Person: A Person contains a first name, last name, street address, zip code, and phone number. The class also includes a method that sets each data field and display method that displays all of a Person’s information. | |
• CollegeEmployee: CollegeEmployee descends from Person. A CollegeEmployee also includes a Social Security number, an annual salary, and a department name, as well as methods that override the Person methods to accept and display all collegeEmployee data. | |
• Faculty: Faculty descends from ColegeEmployee. This class also includes a Boolean field that indicates whether the Faculty member is permanent, as well as methods that override the CollegeEmployee methods to accept and display this additional piece of information. | |
• Student: Student descends from Person. In addition to the fields available in Person, a Student contains a major field of study a |
This file contains hidden or 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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package testsubject; | |
import java.io.*; | |
import java.util.*; | |
/** | |
* |
This file contains hidden or 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
For this task you will create a Subject class, whose instances will represent the subjects for study at a university. A subject will have a name, just a String, and a subject code, which is a six-character String. The first three characters of a subject code are alphabetic and the last three are numeric. The first three characters define the subject's discipline area. A subject code must be unique. | |
You will also write a TestSubject class to test the use of your Subject class. In particular this will maintain an array of subjects. In order to manage the uniqueness of the subject codes, your program will need to display information about existing subject codes as well as checking that any new subject code supplied by the user is not the same as any existing subject code. | |
The following state and functionality should be provided for the Subject class: | |
• Two fields will hold the subject’s name and the six-character subject code. | |
• A constructor will allow a name and a new, validated subject code to be provided wh |
NewerOlder